Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2.  
  3. namespace AppBundle\Controller\Shop;
  4.  
  5. use AppBundle\Entity\Shop\Shop;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
  7. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  8. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  9. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  10.  
  11. /**
  12. * @Route(host="{subdomain}", requirements={"subdomain" = ".*"}, defaults={"subdomain" = "%domain%" })
  13. * @ParamConverter("shop", class="AppBundle:Shop\Shop", options={"subdomain" = "subdomain"})
  14. */
  15. class ShopController extends Controller
  16. {
  17. /**
  18. * @Route("/", name="index")
  19. * @Template()
  20. */
  21. public function indexAction(Shop $shop)
  22. {
  23. return ['shop' => $shop];
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement