Skip to content

No auto-completing using @Template annotation #773

@dev-marcel

Description

@dev-marcel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions