Download the PHP package dyvelop/current-user-bundle without Composer
On this page you can find all versions of the php package dyvelop/current-user-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dyvelop/current-user-bundle
More information about dyvelop/current-user-bundle
Files in dyvelop/current-user-bundle
Package current-user-bundle
Short Description Symfony bundle for fetching the user which is currently logged in
License MIT
Informations about the package current-user-bundle
Dyvelop Current User Bundle
Symfony bundle to fetch the user which is currently logged in.
Installation
Step 1: Download
Download via Composer
Step 2: Enable Bundle
Enable the Bundle in the app/AppKernel.php
file in your Symfony project:
Usage
Current User Provider
Mainly this bundle implements a service named dyvelop.current_user.provider
which provides the current user:
You may use the CurrentUserAware
interface and CurrentUserTrait
helper to inject it into any other service.
Doctrine Annotation
Secondly, this bundle provides a Doctrine Annotation and Driver to inject the Current User into an entity via lifecycle callbacks:
In this example the current user will be set automatically as author of an article before persisting it to the database.
Currently, only the prePersist
and preUpdate
lifecycle callbacks are implemented.
Feel free to contribute some more ;)
All versions of current-user-bundle with dependencies
symfony/config Version ~2.7|~3.0
symfony/dependency-injection Version ~2.7|~3.0
symfony/security Version ~2.7|~3.0
doctrine/annotations Version ~1.2
doctrine/orm Version ~2.5