Poll is a unified extension used to handle all tasks related to documenting the 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 Shield::get('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 Shield::get('poll/vote'); ?>
Shield::get('poll/respond', [ 'q' => 'Was this article helpful?', 'a' => ['Yes', 'No'] ]);
Shield::get('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 ]);