Download the PHP package avoo/achievement-bundle without Composer
On this page you can find all versions of the php package avoo/achievement-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package achievement-bundle
AchievementBundle
![Build Status] (https://scrutinizer-ci.com/g/avoo/AchievementBundle/badges/build.png?b=master) ![Scrutinizer Code Quality] (https://scrutinizer-ci.com/g/avoo/AchievementBundle/badges/quality-score.png?b=master) ![Latest Stable Version] (https://poser.pugx.org/avoo/achievement-bundle/v/stable.svg) ![License] (https://poser.pugx.org/avoo/achievement-bundle/license.svg)
Achievement bundle for Symfony 2
- Installation
- Configuration
- User Achievement class
- Doctrine configuration
- Achievement configuration
- Listener implementation
- Default Usage
- Default Progression
Installation
Require avoo/achievement-bundle
into your composer.json
file:
Register the bundle in app/AppKernel.php
:
Default Configuration
User class
You need to implement Avoo\AchievementBundle\Model\UserInterface
, consider the user class in AppBundle\Entity\User
.
for FOS example:
User Achievement class
Class
Doctrine configuration
In the user class:
YML
XML
Annotation
And now linked the user achievement class with your own user class.
YML
XML
Annotation
Achievement configuration
Define the user achievement class
Add achievement
Listener implementation
Achievement listener example
That's all.
Default Usage
Be careful, if you want to see the achievement progress, you need to be logged!
You can use the default achievement rendering in your views:
Default Progression
Progress example:
Check if current achievement is earned:
Achievement validation, you can implement your own validation process with isValid
function in your listener class:
And now call:
Or override progress
function:
License
This bundle is released under the MIT license. See the complete license in the bundle: