Download the PHP package antares/accessible-bundle without Composer
On this page you can find all versions of the php package antares/accessible-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download antares/accessible-bundle
More information about antares/accessible-bundle
Files in antares/accessible-bundle
Package accessible-bundle
Short Description A bundle to easily use Accessible in Symfony projects.
License MIT
Homepage https://github.com/antares993/AntaresAccessibleBundle
Informations about the package accessible-bundle
AccessibleBundle
AccessibleBundle provides an Accessible integration for your Symfony projects. This will allow you to define your class behavior using powerful annotations.
Here is a (very) basic example:
Here the library is used to generate getters and setters, but it can also be used to manage constructors, attributes initialization, collections and associations between classes!
Suggestions and contributions are welcome!
Documentation
This file contains everything you will need to use this bundle. For details on the use of the library, see the Accessible page.
Installation
First add the bundle in your Composer dependencies:
Then, register the bundle in your kernel:
In order to be compatible with the PropertyAccess
component you should also add the following lines in your configuration:
Configuration
The configuration of this bundle is quite simple, take a look:
Note that you don't need to set the configuration as everything is already configured by default.
Here are the meanings of the configuration values:
cache.enable
: Do you want a cache driver to be used?constraints_validation.enable
: Do you want your class setters to use constraints validation?constraints_validation.validate_initialize_values
: Do you want the@Initialize
and@InitializeObject
values to be validated?
Use a custom cache driver
By default, instances of Doctrine\Common\Cache\PhpFileCache
are used. If you have APC enabled, you should replace the cache driver. You can do it like this:
antares_accessible.cache.driver
is the cache driver used by the libraryantares_accessible.annotations.cache_driver
is the cache driver used by the library's annotation reader
Use a custom annotations reader
You can use a custom annotations reader:
Use a custom validator
You can also use a custom constraints validator, for example, if your project already uses the validator service, you can use it also with this library like this: