A Symfony2 bundle providing annotations to streamline controller actions for pagination, entity loading, forms, and more.
ControllerExtraBundle is a Symfony2 bundle that provides a collection of annotations to streamline and reduce boilerplate code in controller actions. It automates common tasks like pagination, entity loading, form creation, and logging, allowing developers to write more concise and declarative controllers. The bundle integrates seamlessly with Doctrine and Symfony's form component.
Symfony2 developers building applications with Doctrine ORM who want to reduce repetitive controller code and leverage annotation-driven development for common CRUD and data handling operations.
Developers choose ControllerExtraBundle for its declarative approach to controller logic, which eliminates boilerplate and improves code readability. Its extensible annotation system and deep integration with Symfony and Doctrine provide a powerful, convention-based workflow that speeds up development.
Controller extra Bundle for Symfony2
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The @CreatePaginator annotation automates complex Doctrine queries with filtering, ordering, and joins, as shown in examples with configurable page, limit, and attributes like PaginatorAttributes for metadata.
@LoadEntity handles entity loading or creation with mapping, fallback, and custom factory support, reducing repetitive repository calls and error handling in controllers.
@CreateForm injects Form, FormType, or FormView objects, optionally bound to entities and with request handling, streamlining form creation and validation as detailed in the README.
Supports custom annotations with resolvers, allowing developers to extend functionality for project-specific needs, as outlined in the 'Custom annotations' section with service registration.
Specifically targets Symfony2, making it incompatible with modern Symfony versions (3+), which limits its use in current projects without significant modifications or forks.
Annotations like @CreatePaginator require nested arrays for configuration (e.g., orderBy, wheres), which can be verbose, error-prone, and harder to debug compared to plain PHP code.
Requires careful setup of event listener priorities (e.g., resolver_priority must be lower than ParamConverter's) and dependencies on other bundles like Pagerfanta, adding initial complexity.