atm/pollbundle

Poll management bundle

Installs: 18

Dependents: 0

Suggesters: 0

Type:symfony-bundle

1.0.2 2018-11-07 15:38 UTC

README

A Poll Manager System

Installation

Install through composer:

php -d memory_limit=-1 composer.phar require atm/pollbundle

In your AppKernel

public function registerbundles()
{
    return [
    	...
    	...
    	new ATM\PollBundle\ATMPollBundle(),
    ];
}

Routing

Append to main routing file:

# app/config/routing.yml
  
atm_points:
    resource: "@ATMPollBundle/Resources/config/routing.yml"
    prefix:   /

Configuration sample

Default values are shown below:

# app/config/config.yml
  
atm_poll:
    redis_settings:
        host: redis_host
        port: redis_port
        database_id: redis_db
    _key_namespace: 'atm:poll'
    position_order: 'DESC'

Twig Extension

You can use the following twig extension to know how many points a user has:

{{ getCurrentPolls() }}
{{ getPollRanking(pollId) }}