davidjeddy / yii2-poll
Widget to create custom polls for Yii 2.x framework.
2.0.15
2017-12-11 02:17 UTC
Requires
- yiisoft/yii2: ^2.0.13
README
[!WARNING] ⚠️ This project has been archived and is no longer maintained. ⚠️
Github has shown it does not respect its users. Other have said it better than I can.
- https://www.theregister.com/2022/06/30/software_freedom_conservancy_quits_github/
- https://www.andrlik.org/dispatches/migrating-from-github-motivation/
- https://techresolve.blog/2025/12/27/looking-to-migrate-company-off-github-whats-the/
- https://lord.io/leaving-github/
- https://dev.to/alanwest/how-to-actually-migrate-from-github-to-codeberg-without-losing-your-mind-33bf>
Development has moved to Codeberg: ➡️ https://codeberg.org/DavidJEddy/yii2-poll
Please update your remotes:
git remote set-url origin https://codeberg.org/DavidJEddy/yii2-poll
yii2-poll
Badges
About
Create a basic custom polls for Yii 2.x.
Installing
- Run
composer require davidjeddy/yii2-pollon the terminal in your {project root}- OR add
"davidjeddy/yii2-poll": "~2"to your projects composer.json in the "required": [...] section then runcomposer update.
- OR add
- Run migration via Yii's migration command providing
php ./console/yii migrate/up --migrationPath=./vendor/davidjeddy/yii2-poll/migrations
Usage
Basic:
echo \davidjeddy\poll\PollWidget::widget([ 'questionText' => \Yii::t('poll', 'Do you like PHP?'), 'answerOptions' => ['Yes', 'No'], ]);
Advanced:
echo \davidjeddy\poll\PollWidget::widget([ 'questionText' => \Yii::t('poll', 'Do you like PHP?'), 'answerOptions' => ['Yes', 'No'], 'params' => [ 'backgroundLinesColor' => '#DCDCDC',// html hex 'linesColor' => '#DC0079' // html hex 'linesHeight' => 20, // in pixels 'maxLineWidth' => 200, // in pixels ] ]);