davidjeddy / yii2-poll
Widget to create custom polls for Yii 2.x framework.
Installs: 311
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 0
Forks: 1
Open Issues: 0
pkg:composer/davidjeddy/yii2-poll
Requires
- yiisoft/yii2: ^2.0.13
README
Badges
About
Create a basic custom polls for Yii 2.x.
Installing
- Run
composer require davidjeddy/yii2-poll
on 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 ] ]);