Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

01_installation

rbolliger edited this page · 12 revisions

Chapter 1: Installation

Requirements

To work properly, the plugin requires the following plugins to be installed:

  • apostrophePlugin
  • sfFormExtraPlugin

sfFormExtraPlugin is optional and required only if you plan to display a captcha to secure forms submissions. In particular, sfFormExtraPlugin provides a wrapper to display reCaptcha. You can also provide your own captcha widget, as described in chapter 4.

apostrophePollPlugin allows to export answers submitted by users as excel ans CSV files. To enable this feature, you have to install PHPExcel. A symfony plugin exists, but PHPExcel code might be outdated. To get the latest version, it might be useful to download it as a vendor package (using svn externals) and then load it using an autoload.yml configuration file (see the symfony documentation about this file.).

Installation

Using symfony plugin:install

Use this to install apostrophePollPlugin:

symfony plugin:install apostrophePollPlugin

Using git clone

Use this to install as a plugin in a symfony app:

cd plugins
git clone git://github.com/rbolliger/apostrophePollPlugin.git

Using git submodules

Use this if you prefer to use git submodules for plugins:

git submodule add git://github.com/rbolliger/apostrophePollPlugin.git plugins/apostrophePollPlugin   
git submodule init   
git submodule update

Enable the plugin

It the plugin is installed from git or manually, it must be enabled in your project configuration class:

# /config/ProjectConfiguration.class.php   
class ProjectConfiguration extends sfProjectConfiguration   
{   
  public function setup()   
  {    
    $this->enablePlugins('apostrophePollPlugin');   
  }   
}

Enable modules

# /apps/frontend/config/settings.yml   
.settings   
  enabled_modules: [..., aPollSlot, aPollPollAdmin, aPollAnswerAdmin](default,)

Publish assets

Load web assets (css, js, ...)

./symfony plugin:publish-assets

Adding a button in the top area

apostrophePollPlugin provides a new button pointing to the aPollPollAdmin admin module.

Apostrophe provides a mechanism which enables the button to be autoloaded and displayed (see Apostrophe documentation). But, depending on the configuration written in app.yml, it may sometimes be hidden, especially in the sandbox.

If you installed Apostrophe from the sandbox or if you cannot see the button in the admin bar, you have to enable it in app.yml:

# /apps/frontend/config/app.yml
all:
    a:
    global_button_order:
        ...
        - polls
        ...

Declaring the new slot type

To let apostrophe know about the new slot type, you must declare it:

# /apps/frontend/config/app.yml
all:
    a:
        slot_types:
            ...
            aPoll: Poll
            ...

You can also define that this slot may ba added in all areas (where there is not an explicit restriction of available slots):

# /apps/frontend/config/app.yml
all:
    a:
        standard_area_slots:
            ...
            - aPoll
            ...

Build the model

For a fresh install, run:

./symfony doctrine:build --all

or, if you already have a database in place:

./symfony doctrine:build --all-classes 
./symfony apostrophe:migrate
Something went wrong with that request. Please try again.