Skip to content
 
 

Repository files navigation

SensioFrameworkExtraBundle

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+.

Features

  • 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+

Usage

Annotations (Legacy)

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;

/**
 * @Template("default/index.html.twig")
 * @IsGranted("ROLE_USER")
 */
public function index()
{
    // ...
}

PHP Attributes (Recommended)

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;

#[Template('default/index.html.twig')]
#[IsGranted('ROLE_USER')]
public function index()
{
    // ...
}

Read about it on its official homepage.

About

An extension to Symfony FrameworkBundle that adds annotation configuration for Controller classes

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages