Download the PHP package ldar/yii2-builder without Composer
On this page you can find all versions of the php package ldar/yii2-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-builder
yii2-builder
A form builder extension that allows you to build both single view and multi-view/tabular forms for Yii Framework 2.0. The extension contains these widgets:
- Form
- FormGrid
- TabularForm
NOTE: This extension depends on the kartik-v/yii2-widgets extension, which in turn depends on the yiisoft/yii2-bootstrap extension. Check the composer.json for this extension's requirements and dependencies.
Latest Release
The latest version of the module is v1.6.2. Refer the CHANGE LOG for details.
Form
\kartik\builder\Form
The Form Builder widget allows you to build a form through a configuration array. Key features available:
- Configure your form fields from a model extending
yii\base\model
oryii\db\ActiveRecord
. - Ability to support various Bootstrap 3.x form layouts. Uses the advanced
kartik\widgets\ActiveForm
. - Use Bootstrap column/builder layout styling by just supplying
columns
property. - Build complex layouts (for example single, double, or multi columns in the same layout) - by reusing the widget for building your attributes.
- Tweak ActiveForm defaults to control field options, styles, templates, and layouts.
- Configure your own hints to display below each active field attribute.
- Various Bootstrap 3.x styling features are available by default. However, one can easily customize and theme it to one's liking using any CSS framework.
- Supports and renders HTML input types (uses
kartik\widgets\ActiveField
) including input widgets and more:INPUT_TEXT
ortextInput
INPUT_TEXTAREA
ortextarea
INPUT_PASSWORD
orpasswordInput
INPUT_DROPDOWN_LIST
ordropdownList
INPUT_LIST_BOX
orlistBox
INPUT_CHECKBOX
orcheckbox
INPUT_RADIO
orradio
INPUT_CHECKBOX_LIST
orcheckboxList
INPUT_CHECKBOX_BUTTON_GROUP
orcheckboxList
INPUT_RADIO_LIST
orradioList
INPUT_MULTISELECT
ormultiselect
INPUT_FILE
orfileInput
INPUT_HTML5
orinput
INPUT_WIDGET
orwidget
INPUT_HIDDEN
orhiddenInput
INPUT_STATIC
orstaticInput
INPUT_HIDDEN_STATIC
orhiddenStaticInput
INPUT_RAW
orraw
(any free text or html markup)
Refer the documentation for more details.
FormGrid
\kartik\builder\FormGrid
Create bootstrap grid layouts in a snap. The Form Grid Builder widget offers an easy way to configure your form inputs as a bootstrap grid layout and a single array configuration. It basically uses
multiple instances of the \kartik\builder\Form
widget above to generate this grid. One needs to just setup the rows for the grid,
where each row will be an array configuration as needed by the Form
widget. However, most of the common settings like model
, form
,
columns
etc. can be defaulted at FormGrid
widget level.
Tabular Form
kartik\builder\TabularForm
The tabular form allows you to update information from multiple models (typically used in master-detail forms). Key features
- Supports all input types as mentioned in the
Form
builder widget - The widget works like a Yii GridView and uses an ActiveDataProvider to read the models information.
- Supports features of the builderview like pagination and sorting.
- Allows you to highlight and select table rows
- Allows you to add and configure action buttons for each row.
- Configure your own hints to display below each active field attribute.
- Various Bootstrap 3.x styling features are available by default. However, one can easily customize and theme it to one's liking using any CSS framework.
- Advanced table styling, columns, and layout configuration by using the features available in the [
kartik\builder\GridView
](kartik\widgets\ActiveForm
widget. - One can easily read and manage the tabular input data using the
loadMultiple
andvalidateMultiple
functions inyii\base\Model
.
NOTE: The TabularForm widget depends on and uses the yii2-grid module. Hence, the
gridview
module needs to be setup in your Yii configuration file.IMPORTANT: You must follow one of the two options to setup your DataProvider or your columns to ensure primary key for each record is properly identified.
- Option 1 (preferred): Setup your dataProvider query to use
indexBy
method to index your records by primary key. For example:
- Option 2 (alternate): You can setup the primary key attribute as one of your columns with a form input type (and hide if needed) - so that the models are appropriately updated via
loadMultiple
method (even if you reorder or sort the columns). You must also set this attribute to besafe
in your model validation rules. This is been depicted in the example below.
Demo
You can see detailed documentation on usage of the extension.
Installation
The preferred way to install this extension is through composer.
Note: You must set the
minimum-stability
todev
in the composer.json file in your application root folder before installation of this extension.
Either run
or add
to the section of your composer.json
file.
Usage
Form
FormGrid
TabularForm
License
yii2-builder is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.
All versions of yii2-builder with dependencies
kartik-v/yii2-helpers Version ~1.3
kartik-v/yii2-widget-activeform Version ~1.4
kartik-v/yii2-grid Version ~3.0