09/09/2014 - SYMFONY, TWIG
Examples below are useful tips for us to benefit from in twig templates.
{{ app.request.attributes.get("_controller") }}
# Output
Football\FrontendBundle\Controller\DefaultController::indexAction
{{ app.request.attributes.get('_route') }}
# Output
football_frontend_homepage
{{ dump(app.request.attributes.get('_route_params')) }}
# Output - Assuming that the URI is http://sport.local/app_dev.php/inanzzz
array:1 [
"name" => "inanzzz"
]
# URL
app_test.php/emails?type=delivered&from_date=26-02-2015&to_date=26-02-2016&limit=25&keyword=
{{ dump(app.request.query.all) }}
# Output
array:5 [
"type" => "delivered"
"from_date" => "26-02-2015"
"to_date" => "26-02-2016"
"limit" => "25"
"keyword" => ""
]