This bundle provides a way to configure your controllers with annotations and PHP attributes.
Note: This bundle is maintained for backward compatibility. For new projects, consider using native PHP attributes as added in Symfony core. For full support, use Symfony 6.2+.
- Annotations Support: Configure controllers using Doctrine annotations
- PHP Attributes Support: Configure controllers using PHP 8.0+ attributes
- Symfony 7 Compatibility: Full compatibility with Symfony 7.0+
useSensio\Bundle\FrameworkExtraBundle\Configuration\Template;
useSensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
/** * @Template("default/index.html.twig") * @IsGranted("ROLE_USER") */publicfunctionindex()
{
// ...
}useSensio\Bundle\FrameworkExtraBundle\Configuration\Template;
useSensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
#[Template('default/index.html.twig')]
#[IsGranted('ROLE_USER')]
publicfunctionindex()
{
// ...
}Read about it on its official homepage.