A simple poll bundle for symfony2., (*1)
This version is for Symfony 2.4.x projects., (*2)
For Symfony 2.0.x projects, you must use a 1.x release of this bundle., (*3)
Features
- List of all published polls
- Uses Ajax for voting and showing results
- Results displayed using bar graphs
- Uses cookies to prevent multiple voting
- A backend interface
- Easily overridable
Screenshots:, (*4)
Note: The backend doesn't come with an authentication system., (*5)
TODO:, (*6)
- Functional tests
- Rewrite "Overriding the bundle" documentation for symfony 2.4.x
Installation
1. Add this to your composer.json:
``` yml
"require": {
"prism/poll-bundle": "dev-master"
}, (*7)
**2.** Run a composer update:
``` bash
$ composer update
3. Register the bundle in app/AppKernel.php
:, (*8)
(You also need to add StofDoctrineExtensionsBundle for the timestampable and sluggable features), (*9)
``` php
$bundles = array(
// ...
new Prism\PollBundle\PrismPollBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
);, (*10)
**4.** Import routing:
``` yaml
# app/config/routing.yml
PrismPollBundle_backend:
prefix: /poll/backend
resource: "@PrismPollBundle/Resources/config/routing/backend.yml"
PrismPollBundle_frontend:
prefix: /poll
resource: "@PrismPollBundle/Resources/config/routing/frontend.yml"
5. Add configuration for DoctrineExtensions:, (*11)
``` yaml, (*12)
app/config/config.yml
stof_doctrine_extensions:
orm:
default:
timestampable: true
sluggable: true, (*13)
**6.** Generate the tables:
``` bash
$ app/console doctrine:schema:update --force
This will create the PrismPoll and PrismPollOpinion tables, (*14)
Overriding the bundle
TODO: rewrite the documentation for Symfony 2.4.x projects., (*15)
You can still get the general idea by reading the documentation for Symfony 2.0.x projects., (*16)