Mecha CMS

Add extra functionality to the core engine.

Poll

Poll is a unified extension used to handle all tasks related to documenting user’s input.

Surely you’ve seen features such as like and reaction buttons on Facebook and on most portal websites, plus one on Google+, feedback on documentation/support websites. This extension brings them all together into a simpler yet more extensible system in a single folder.

Core 

<?php

static::poll([
    'q' => 'Your Title', // Optional
    'h' => 'Hints.', // Optional
    'a' => [ // Optional for `poll` with namespace(s)
        'key_1' => [
            'i' => '&#x2764;', // Button text (usually an icon)
            'title' => 'Love this!' // Button title (usually used to describe about the icon)
        ],
        'key_2' => [ … ],
        'key_3' => [ … ],
        …
        …
    ]
]);

?>

Usage 

Put this snippet in your page.php file to add a vote up/down feature on your page. Usually just before the </footer> tag:

<?php static::poll('vote'); ?>

Feature 

Like 

1

static::poll('like');

Love 

2

static::poll('love');

Reaction 

3

static::poll('react');

Response 

4

static::poll('respond', [
    'q' => 'Was this article helpful?',
    'a' => ['Yes', 'No']
]);

Vote 

5

static::poll('vote');

Custom 

static::poll('respond', [
    'q' => 'Is throwing your hair in the garbage safe?',
    'h' => 'I wanted to be sure because in biology we learned that it had DNA and stuff so is it safe?',
    'a' => [
        'yes' => 'Yes it is.',
        'no' => 'No. I don’t think so.'
    ],
    'path' => 'my-poll' // Path relative to `LOT` folder to store the polling data
]);

Dependency 

Extension