Guest User

Untitled

a guest
Jan 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1. app routing.yml:
  2.  
  3. TestBundle:
  4.   resource: "@TestBundle/Controller/DefaultController.php"
  5.   type: annotation
  6.  
  7. bundle routing.yml is empty
  8.  
  9. the controller:
  10.  
  11.  
  12. <?php
  13.  
  14. namespace Acme\TestBundle\Controller;
  15.  
  16. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  17.  
  18. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  19. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
  20. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  21. use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
  22.  
  23.  
  24. /*
  25.  * @Route("/tests")
  26.  */
  27. class DefaultController extends Controller
  28. {
  29.    
  30.     /*
  31.     * @Route("/index/{name}")
  32.     */
  33.     public function indexAction($name)
  34.     {
  35.         return $this->render('TestBundle:Default:index.html.twig', array('name' => $name));
  36.     }
  37.    
  38.     public function homepageAction($name)
  39.     {
  40.         $autore = \Acme\TestBundle\Model\AuthorQuery::create()->findOne();
  41.        
  42.         return $this->render('TestBundle:Default:homepage.html.twig', array('name' => $name,'autore'=>$autore));
  43.     }
  44. }
Add Comment
Please, Sign In to add comment