zakharov-andrew / yii2-survey-forms-widget
Yii2 Survey Form widget
Installs: 147
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7.0
- zakharov-andrew/survey-forms: ^0.1.0
README
Survey module for Yii2 application. Use SurveyForms.js javascript library
Installation
The preferred way to install this extension is through composer.
Either run
$ composer require zakharov-andrew/yii2-survey-forms-widget
or add
"zakharov-andrew/yii2-survey-forms-widget": "*"
to the require
section of your composer.json
file.
Usage
use surveyforms\survey\Survey;
echo SurveyWidget::widget([
'id' => 'survey-forms',
'title' => 'First Survey Test',
'description' => 'Simple description. SurveyForms.js demo',
'background_color' => '#f7fafc',
'question' => [
(object)[
'title' => 'Test Title 1',
'required' => true,
'options' => ['one', 'two', 'zero']
],
(object)[
'title' => 'Test Title 2',
'required' => false,
'options' => ['1', '2', '3'],
'score' => 5
],
(object)[
'title' => 'Test Title 3',
'type' => 'select',
'required' => true,
'options' => ['option 1', 'option 2', 'option 3'],
'score' => 5
],
]
]);