PHP code example of onmotion / yii2-survey

1. Go to this page and download the library: Download onmotion/yii2-survey library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

onmotion / yii2-survey example snippets


'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'],
//                    ],
//                ],
//            ],
    ],
//...
]

echo \onmotion\survey\Survey::widget([
   'surveyId' => 1
]);
sh
php yii migrate --migrationPath=@vendor/onmotion/yii2-survey/migrations