All Projects → pceuropa → yii2-forms

pceuropa / yii2-forms

Licence: MIT License
Forms CRUD - formbuilder, generator code

Programming Languages

javascript
184084 projects - #8 most used programming language
PHP
23972 projects - #3 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to yii2-forms

Uploader
A lightweight and very configurable jQuery plugin for file uploading using ajax(a sync); includes support for queues, progress tracking and drag and drop.
Stars: ✭ 1,042 (+3156.25%)
Mutual labels:  forms, drag, drop, ajax
multi-step-form
A free WordPress plugin for dynamic multi-step forms.
Stars: ✭ 32 (+0%)
Mutual labels:  forms, drag, drop
yii2-menu
Menu menager, dynamic Yii2 widget. Active menu items
Stars: ✭ 26 (-18.75%)
Mutual labels:  drag, drop, yii2-extension
jOrgChart
Here more functionality of jquery orgchart with json support
Stars: ✭ 29 (-9.37%)
Mutual labels:  drag, drop
react-cool-form
😎 📋 React hooks for forms state and validation, less code more performant.
Stars: ✭ 246 (+668.75%)
Mutual labels:  forms, form-builder
yii2-formbuilder
A drag and drop form builder with jQuery for Yii2
Stars: ✭ 33 (+3.13%)
Mutual labels:  form-builder, yii2-extension
view component-form
Rails FormBuilder for ViewComponent
Stars: ✭ 120 (+275%)
Mutual labels:  forms, form-builder
BileTools
Tools for making garbage
Stars: ✭ 31 (-3.12%)
Mutual labels:  drag, drop
ember-formly
JavaScript powered forms for Ember
Stars: ✭ 24 (-25%)
Mutual labels:  forms, form-builder
rc-dock
Dock Layout for React Component
Stars: ✭ 318 (+893.75%)
Mutual labels:  drag, drop
django-formidable
On the way to glory! again!
Stars: ✭ 19 (-40.62%)
Mutual labels:  forms, form-builder
dockview
Zero dependency layout manager and builder with ReactJS support
Stars: ✭ 45 (+40.63%)
Mutual labels:  drag, drop
formio
Formio, form definition and binding library for Java platform
Stars: ✭ 24 (-25%)
Mutual labels:  forms, form-builder
navbuilder
Generiert frei definierbare Navigationsbäume mittels Drag & Drop
Stars: ✭ 21 (-34.37%)
Mutual labels:  drag, drop
form.js
🖍️ Automagic forms.
Stars: ✭ 16 (-50%)
Mutual labels:  forms, ajax
django-siteforms
Django reusable app to simplify form construction
Stars: ✭ 15 (-53.12%)
Mutual labels:  forms, form-builder
KDRearrangeableCollectionViewFlowLayout
A Drag and Rearrange UICollectionView through its layout
Stars: ✭ 73 (+128.13%)
Mutual labels:  drag, drop
jquery-ajaxSubmit
Effortlessly submit forms using AJAX and JSON.
Stars: ✭ 39 (+21.88%)
Mutual labels:  forms, ajax
KanbanDragDropiOS
Kanban Board using Drag & Drop iOS API
Stars: ✭ 95 (+196.88%)
Mutual labels:  drag, drop
Windows11DragAndDropToTaskbarFix
"Windows 11 Drag & Drop to the Taskbar (Fix)" fixes the missing "Drag & Drop to the Taskbar" support in Windows 11. It works with the new Windows 11 taskbar and does not require nasty changes like UndockingDisabled or restoration of the classic taskbar.
Stars: ✭ 1,089 (+3303.13%)
Mutual labels:  drag, drop

FormBuilder module for Yii2

Latest Stable Version Total Downloads License

FormBuilder DEMO

Features

  1. Generate forms, surveys, polls, questionnaires (class FormBuilder)
  • Drag and drop - Sorting, editing, and deleting items
  • CRUD operations by AJAX
  • Built-in RBAC component
  1. Form render widget (class Form)
  • Validation forms (dynamic model)
  1. Storage data submited from form in databases
  • List of forms (GridView)
  • Create database tables after create form
  • Delete database tables after delete form
  • Add table column after add field to form
  • Rename table column after change the name of field
  • Drop table column after delete field in form

Installation Form Builder

composer require pceuropa/yii2-forms

Configuration Form Builder

Make sure that you have properly configured db application component in config file and run the following command:

$ php yii migrate/up --migrationPath=@vendor/pceuropa/yii2-forms/migrations

Add the following code in your configuration file:

'modules' => [
    'forms' => [
          'class' => 'pceuropa\forms\Module',
     ],
]

Usage

URLs for the translating tool:

/forms/module/index                    // List of all forms                     
/forms/module/user                     // List user's forms
/forms/module/view                     // Preview form
/forms/module/create                   // Create form - FormBuilder 
/forms/module/update                   // Update form 
/forms/module/delete                   // Delete form

Full example configuration Form Builder

'modules' => [
      'forms' => [
          'class' => 'pceuropa\forms\Module',
          'db' => 'db',
          'formsTable' => '{{%forms}}',
          'formDataTable' => 'form_',
          'sendEmail' => true, 
	  'testMode' => false, 
          'easyMode' => true,
          'emailSender' => '[email protected]',
          'rules' => [
                [
                    'actions' => [ 'update', 'delete', 'clone'],
                    'allow' => true,
                    'roles' => ['updateOwnForm'],   // rule only owner can edit form
                ],
                [
                    'actions' => ['user'],
                    'allow' => true,
                    'roles' => ['user'],     // role only authenticated user can see user's forms
                ],
                [
                    'actions' => ['create'],
                    'allow' => true,
                    'roles' => ['@'],        // role only logged user can create form
                ]
            ]
      ]
],

'components' => [
	  'authManager' => ['class' => 'yii\rbac\DbManager',],
]

Form renderer widget

use pceuropa\forms\Form;
echo Form::widget([
     'body' => '[[{"field": "input", "type": "text", "width": "col-md-5", "name": "email", "placeholder": "email"},{"field": "input", "name": "pass", "type": "text", "placeholder": "pass", "width": "col-md-5"},{"field": "submit", "width": "col-md-2", "backgroundcolor": "btn-info", "label": "Submit"}]]',
     'typeRender' => 'php'
     ]);

or

  echo Form::widget([
     'formId' => 1, // equivalennt 'form' => FormModel::findOne(1)->body
  ]);

Configure RBAC Component

To use generator console, add fallowing code to console config (console.php)

'controllerMap' => [
  'formsrbac' => [
      'class' => 'pceuropa\forms\migrations\RbacController',
  ],
],

To use RBAC dont forget add fallowing code to app config (web.php or main.php)

'components' => [
	  'authManager' => ['class' => 'yii\rbac\DbManager',],
]

Create rbac tables in the database yii migrate --migrationPath=@yii/rbac/migrations

Create RBAC rules and roles. Asssign role user to all users. You can add assign role acction in SignupController php yii formsrbac/generate

Tests

Php tests run

vendor/bin/codecept run -c vendor/pceuropa/yii2-forms

or

cd vendor/pceuropa/yii2-forms
../../bin/codecept run

JavaScript tests run On begining install depencies:

cd vendor/pceuropa/yii2-forms
npm install

run test

cd vendor/pceuropa/yii2-forms
karma start
//or if you use karma localy
npm run test

ex. Menu

[
'label' => 'forms',
    'items' => [
        ['label' => 'List of all forms', 'url' => ['/forms/module/index']],
        ['label' => 'User\'s forms', 
            'url' => ['/forms/module/user'],
            'visible' => !Yii::$app->user->isGuest
        ],
        ['label' => 'Create form', 'url' => ['/forms/module/create']],
    ],
],
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].