50 lines
1.9 KiB
PHP
50 lines
1.9 KiB
PHP
<?php
|
|
|
|
use itguild\forms\Form;
|
|
use \itguild\forms\inputs\TextInput;
|
|
use \itguild\forms\inputs\Radio;
|
|
use \itguild\forms\inputs\Select;
|
|
use \itguild\forms\ActiveForm;
|
|
|
|
ini_set("display_errors", true);
|
|
error_reporting(-1);
|
|
|
|
require_once "vendor/autoload.php";
|
|
|
|
$form = new Form();
|
|
$form->beginForm("tsad");
|
|
$form->textInput("phone", ['placeholder' => 'Введите телефон', 'class' => 'form-group']);
|
|
$form->textInput("email", ['placeholder' => 'Введите email']);
|
|
$form->textInput("name", ['type' => 'number']);
|
|
$form->textInput("lastname");
|
|
$form->checkBox("Button", "1", ["class" => 'sdsa', "id" => "b1"]);
|
|
$form->checkBox("Button", "2", ["class" => 'sdsa', "id" => "b1"]);
|
|
$form->checkBox("Button", "3", ["class" => 'sdsa', "id" => "b1"]);
|
|
$form->label("RadioButton", ["for" => "r2"]);
|
|
$form->radio("name1", ["id" => "r2"]);
|
|
$form->label("RadioButton", ["for" => "r3"]);
|
|
$form->radio("name1", ["id" => "r3"]);
|
|
$form->textarea("textarea", "dsadasads", ["id" => "t1"]);
|
|
$form->select("select", ["class1" => "option", "class2" => "b2", "class3" => "b4"], 'class2', ["id" => "s1"]);
|
|
$form->button('button', "Кнопка", ["id" => "button"]);
|
|
$form->endForm();
|
|
|
|
$activeForm = new ActiveForm();
|
|
$activeForm->field(class: TextInput::class, name: 'nnn', params: ["style" => "color:RED;display:flex"])
|
|
->render();
|
|
|
|
$activeForm->field(class: TextInput::class, name: 'bbb', params: [])
|
|
->render();
|
|
|
|
$activeForm->field(class: Radio::class, name: 'nameee',params: ["style" => "color:RED;display:flex"])
|
|
->setOptions(['1' => 'bbb1', '2' => 'vvv3', 3 => 'ggg3', 4 => 'fgfgfgfg4'])
|
|
->setLabel("bbb222bbb")
|
|
->render();
|
|
|
|
$activeForm->field(class: Radio::class, name: 'nameee',params: ["style" => "color:RED;display:flex"])
|
|
->setLabel("bbbbbb")
|
|
->render();
|
|
|
|
$activeForm->field(Select::class, 'ddd', ['value' => 2])
|
|
->setOptions(['1' => 'bbb1', '2' => 'vvv3', 3 => 'ggg3', 4 => 'fgfgfgfg4'])
|
|
->render(); |