Download the PHP package wdmg/yii2-forms without Composer
On this page you can find all versions of the php package wdmg/yii2-forms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wdmg/yii2-forms
More information about wdmg/yii2-forms
Files in wdmg/yii2-forms
Package yii2-forms
Short Description Creation and management of user forms
License MIT
Homepage https://github.com/wdmg/yii2-forms
Informations about the package yii2-forms
Yii2 Forms
Module for creating and administering composite forms for Yii2. It also records and manages the results of filling out forms on the site. It has its own component for building and displaying forms in the frontend. Supports multilingual fields and descriptions.
This module is an integral part of the Butterfly.СMS content management system, but can also be used as an standalone extension.
Copyrights (c) 2019-2021 W.D.M.Group, Ukraine
Requirements
- PHP 5.6 or higher
- Yii2 v.2.0.40 and newest
- Yii2 Base module (required)
Installation
To install the module, run the following command in the console:
$ composer require "wdmg/yii2-forms"
After configure db connection, run the following command in the console:
$ php yii forms/init
And select the operation you want to perform: 1) Apply all module migrations 2) Revert all module migrations 3) Add demo data
Migrations
In any case, you can execute the migration and create the initial data, run the following command in the console:
$ php yii migrate --migrationPath=@vendor/wdmg/yii2-forms/migrations
Configure
To add a module to the project, add the following data in your configuration file:
'modules' => [
...
'forms' => [
'class' => 'wdmg\forms\Module',
'routePrefix' => 'admin'
],
...
],
Usage examples
To build the ActiveForm with fields you may use the component method Yii::$app->forms->build() with id
or alias
of form item.
View in frontend
<h3>Feedback</h3>
<?= Yii::$app->forms->build($form, 'feedback-form'); ?>
<?= Html::submitButton('Submit') ?>
...
<h3>Callback</h3>
<?= Yii::$app->forms->build($form, 'сallback-form'); ?>
<?= Html::submitButton('Submit') ?>
Action in Controller
Routing
Use the Module::dashboardNavItems()
method of the module to generate a navigation items list for NavBar, like this:
Status and version [ready to use]
- v.1.2.0 - Update copyrights, fix menu dashboard
- v.1.1.2 - RBAC implementation
- v.1.1.1 - Update README.md and setAttributeLabels() fixed
All versions of yii2-forms with dependencies
wdmg/yii2-base Version ^1.3.0
wdmg/yii2-helpers Version ^1.4.2
wdmg/yii2-selectinput Version ^1.0.9