Giter Site home page Giter Site logo

yii2-survey's Introduction

Survey module for Yii2 application

Latest Stable Version Total Downloads Monthly Downloads License

! Note: the module under active developing, so it may have vary errors and unstable work. Highly appreciate your PR.

fluent

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.

fluent

After that you can select Survey entities and show it for user, for example:

echo \onmotion\survey\Survey::widget([
   'surveyId' => 1
]);

fluent

Admin:

fluent

fluent

yii2-survey's People

Contributors

onmotion avatar hguenot avatar ivandanothabeer avatar marcinmisiak avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.