56 lines
2.0 KiB
PHP
56 lines
2.0 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";
|
|
|
|
$formData = [];
|
|
|
|
$form = new Form();
|
|
$form->beginForm("checkPOST.php");
|
|
$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("radio1", ["id" => "r2"]);
|
|
$form->label("RadioButton", ["for" => "r3"]);
|
|
$form->radio("radio1", ["id" => "r3"]);
|
|
$form->textarea("textarea", "dsadasads", ["id" => "t1"]);
|
|
$form->select("select", ["class1" => "option", "class2" => "b2", "class3" => "b4"], 'class2', ["id" => "s1"]);
|
|
|
|
|
|
$activeForm = new ActiveForm();
|
|
$activeForm->field(class: TextInput::class, name: 'one', params: ["style" => "color:RED;display:flex"])
|
|
->render();
|
|
|
|
$activeForm->field(class: TextInput::class, name: 'two', params: [])
|
|
->render();
|
|
|
|
$activeForm->field(class: Radio::class, name: 'radio2',params: ["style" => "color:RED;display:flex"])
|
|
->setOptions(['1' => 'bbb1', '2' => 'vvv3', 3 => 'ggg3', 4 => 'fgfgfgfg4'])
|
|
->setTemplate("<div class='form-group'>{label}{input}</div>")
|
|
->setLabel("bbb222bbb")
|
|
->render();
|
|
|
|
$activeForm->field(class: Radio::class, name: 'radio2',params: ["style" => "color:RED;display:flex"])
|
|
->setLabel("bbbbbb")
|
|
->render();
|
|
|
|
$activeForm->field(Select::class, 'select2', ['value' => 2])
|
|
->setOptions(['1' => 'bbb1', '2' => 'vvv3', 3 => 'ggg3', 4 => 'fgfgfgfg4'])
|
|
->render();
|
|
$form->button('button', "Кнопка", ["id" => "button"]);
|
|
$form->endForm();
|
|
|