onmotion / yii2-survey
survey module for Yii2 application
Installs: 924
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 8
Forks: 20
Open Issues: 7
Type:yii2-extension
Requires
- php: >=5.5.0
- cenotia/yii2-remote-modal: ^1.0
- kartik-v/yii2-dialog: ^1.0
- kartik-v/yii2-editable: ^1.7
- kartik-v/yii2-helpers: ^1.3
- kartik-v/yii2-slider: ^1.3
- kartik-v/yii2-widget-datepicker: ^1.4
- kartik-v/yii2-widget-datetimepicker: ^1.4
- kartik-v/yii2-widget-select2: ^2.1
- onmotion/yii2-widget-upload-crop: >=0.5
- vova07/yii2-imperavi-widget: ^2.0
- yiisoft/yii2: >=2.0.1
- yiisoft/yii2-imagine: ^2.1
This package is auto-updated.
Last update: 2024-10-29 05:34:22 UTC
README
! Note: the module under active developing, so it may have vary errors and unstable work. Highly appreciate your PR.
Installation
-
Just run:
composer require onmotion/yii2-survey
or add
"onmotion/yii2-survey": "*"
to the require section of your composer.json file.
- apply migration:
php yii migrate --migrationPath=@vendor/onmotion/yii2-survey/migrations
- Define module to your config:
'modules' => [ //... 'survey' => [ 'class' => '\onmotion\survey\Module', 'params' => [ 'uploadsUrl' => 'http://advanced-frontend.lh/uploads/survey/', // full URL of the folder where the images will be uploaded. // 'uploadsUrl' => '/uploads/survey/', // or for basic 'uploadsPath' => '@frontend/web/uploads/survey/', // absolute path to the folder where images will be saved. ], // 'as access' => [ // 'class' => AccessControl::class, // 'except' => ['default/done'], // 'only' => ['default*'], // 'rules' => [ // [ // 'allow' => true, // 'roles' => ['survey'], // ], // ], // ], ], //... ]
don't forget change your own params.
Usage
If you are using the Yii basic template, you must manually define $controllerNamespace
for module.
onmotion\survey\controllers - backend (admin/create/edit surveys)
onmotion\survey\widgetControllers - default (for widget)
Now go to /survey
in your backend and create a survey.
After that you can select Survey entities and show it for user, for example:
echo \onmotion\survey\Survey::widget([ 'surveyId' => 1 ]);
Admin: