When using the @template annotation for actions:
/**
* @author Marcel van Nuil marcel@ambta.com
* @route("{edmCampaign}", name="_dashboard_edm_campaign_view")
* @Security("has_role('ROLE_ADMIN') or has_role('ROLE_USER') or has_role('ROLE_TELEMARKETER') or has_role('ROLE_COMPANY_USER')")
* @template("ExampleBundle:Template/Dashboard/Pages/Edm:CampaignView.html.twig")
* @ParamConverter("edmCampaign")
*
* @param EdmCampaign $edmCampaign
*
* @return array
*/
public function viewAction(EdmCampaign $edmCampaign)
{
return [
'edmCampaign' => $edmCampaign
];
}
You do not have auto-completing in the Twig template. This only works when you use return $this->render. For ease we now use both, but would be nice if only the @template annotation would be sufficient.
When using the @template annotation for actions:
You do not have auto-completing in the Twig template. This only works when you use return $this->render. For ease we now use both, but would be nice if only the @template annotation would be sufficient.