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.
<?php static::poll([ 'q' => 'Your Title', // Optional 'h' => 'Hints.', // Optional 'a' => [ // Optional for `poll` with namespace(s) 'key_1' => [ 'i' => '❤', // Button text (usually an icon) 'title' => 'Love this!' // Button title (usually used to describe about the icon) ], 'key_2' => [ … ], 'key_3' => [ … ], … … ] ]); ?>
Put this snippet in your
page.php file to add a vote up/down feature on your page. Usually just before the
<?php static::poll('vote'); ?>
static::poll('respond', [ 'q' => 'Was this article helpful?', 'a' => ['Yes', 'No'] ]);
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 ]);