Controller/ConfigController.php
public function listAction()
	{
		if ( false === $this->get('security.authorization_checker')->isGranted('ROLE_ADMIN') )
			throw new AccessDeniedException();
	
		// Set Datagrid source
		$source = new Entity($this->get('asf_website.config.manager')->getClassName());
		$tableAlias = $source->getTableAlias();
		$source->manipulateQuery(function($query) use ($tableAlias){
			$query instanceof QueryBuilder;

			if ( count($query->getDQLPart('orderBy')) == 0) {
				$query->orderBy($tableAlias . '.name', 'ASC');
			}
		});

		// Get Grid instance
		$grid = $this->get('grid');
		$grid instanceof Grid;

		// Attach the source to the grid
		$grid->setSource($source);
		$grid->setId('asf_website_config_list');

		// Columns configuration
		$grid->hideColumns(array('id'));
	
		$grid->getColumn('name')->setTitle($this->get('translator')->trans('Config name', array(), 'asf_website'))
			->setDefaultOperator('like')
			->setOperatorsVisible(false);

		$editAction = new RowAction('btn_edit', 'asf_website_config_edit');
		$editAction->setRouteParameters(array('id'));
		$grid->addRowAction($editAction);

		$deleteAction = new RowAction('btn_delete', 'asf_website_config_delete', true);
		$deleteAction->setRouteParameters(array('id'))
			->setConfirmMessage($this->get('translator')->trans('Do you want to delete this config?', array(), 'asf_website'));
		$grid->addRowAction($deleteAction);
	
		$grid->setNoDataMessage($this->get('translator')->trans('No config was found.', array(), 'asf_website'));
	
		return $grid->getGridResponse('ASFWebsiteBundle:Config:list.html.twig');
	}
public function listAction()
	{
		if ( false === $this->get('security.authorization_checker')->isGranted('ROLE_ADMIN') )
			throw new AccessDeniedException();
	
		// Set Datagrid source
		$source = new Entity($this->get('asf_website.config.manager')->getClassName());
		$tableAlias = $source->getTableAlias();
		$source->manipulateQuery(function($query) use ($tableAlias){
			$query instanceof QueryBuilder;

			if ( count($query->getDQLPart('orderBy')) == 0) {
				$query->orderBy($tableAlias . '.name', 'ASC');
			}
		});

		// Get Grid instance
		$grid = $this->get('grid');
		$grid instanceof Grid;

		// Attach the source to the grid
		$grid->setSource($source);
		$grid->setId('asf_website_config_list');

		// Columns configuration
		$grid->hideColumns(array('id'));
	
		$grid->getColumn('name')->setTitle($this->get('translator')->trans('Config name', array(), 'asf_website'))
			->setDefaultOperator('like')
			->setOperatorsVisible(false);

		$editAction = new RowAction('btn_edit', 'asf_website_config_edit');
		$editAction->setRouteParameters(array('id'));
		$grid->addRowAction($editAction);

		$deleteAction = new RowAction('btn_delete', 'asf_website_config_delete', true);
		$deleteAction->setRouteParameters(array('id'))
			->setConfirmMessage($this->get('translator')->trans('Do you want to delete this config?', array(), 'asf_website'));
		$grid->addRowAction($deleteAction);
	
		$grid->setNoDataMessage($this->get('translator')->trans('No config was found.', array(), 'asf_website'));
	
		return $grid->getGridResponse('ASFWebsiteBundle:Config:list.html.twig');
	}
public function listAction ( ) { if ( false === $ this -> get ( 'security.authorization_checker' ) -> isGranted ( 'ROLE_ADMIN' ) ) throw new AccessDeniedException ( ) ; // Set Datagrid source $ source = new Entity ( $ this -> get ( 'asf_website.config.manager' ) -> getClassName ( ) ) ; $ tableAlias = $ source -> getTableAlias ( ) ; $ source -> manipulateQuery ( function ( $ query ) use ( $ tableAlias ) { $ query instanceof QueryBuilder ; if ( count ( $ query -> getDQLPart ( 'orderBy' ) ) == 0 ) { $ query -> orderBy ( $ tableAlias . '.name' , 'ASC' ) ; } } ) ; // Get Grid instance $ grid = $ this -> get ( 'grid' ) ; $ grid instanceof Grid ; // Attach the source to the grid $ grid -> setSource ( $ source ) ; $ grid -> setId ( 'asf_website_config_list' ) ; // Columns configuration $ grid -> hideColumns ( array ( 'id' ) ) ; $ grid -> getColumn ( 'name' ) -> setTitle ( $ this -> get ( 'translator' ) -> trans ( 'Config name' , array ( ) , 'asf_website' ) ) -> setDefaultOperator ( 'like' ) -> setOperatorsVisible ( false ) ; $ editAction = new RowAction ( 'btn_edit' , 'asf_website_config_edit' ) ; $ editAction -> setRouteParameters ( array ( 'id' ) ) ; $ grid -> addRowAction ( $ editAction ) ; $ deleteAction = new RowAction ( 'btn_delete' , 'asf_website_config_delete' , true ) ; $ deleteAction -> setRouteParameters ( array ( 'id' ) ) -> setConfirmMessage ( $ this -> get ( 'translator' ) -> trans ( 'Do you want to delete this config?' , array ( ) , 'asf_website' ) ) ; $ grid -> addRowAction ( $ deleteAction ) ; $ grid -> setNoDataMessage ( $ this -> get ( 'translator' ) -> trans ( 'No config was found.' , array ( ) , 'asf_website' ) ) ; return $ grid -> getGridResponse ( 'ASFWebsiteBundle:Config:list.html.twig' ) ; }
List all website config

@throws AccessDeniedException If authenticate user is not allowed to access to this resource (minimum ROLE_ADMIN)
@return \Symfony\Component\HttpFoundation\Response
List all website config