firstPHP/index.php

48 lines
1.9 KiB
PHP
Raw Normal View History

2024-03-15 14:17:25 +03:00
<?php
2024-03-15 16:56:03 +03:00
use itguild\forms\Form;
use \itguild\forms\inputs\TextInput;
use \itguild\forms\inputs\Radio;
2024-03-15 14:17:25 +03:00
ini_set("display_errors", true);
error_reporting(-1);
2024-03-15 16:56:03 +03:00
require_once "vendor/autoload.php";
2024-03-15 14:17:25 +03:00
$form = new Form();
$form->beginForm("tsad");
$form->textInput("phone", ['placeholder' => 'Введите телефон', 'class' => 'form-group']);
$form->textInput("email", ['placeholder' => 'Введите email']);
$form->textInput("name", ['type' => 'number']);
2024-03-15 14:25:06 +03:00
$form->textInput("lastname");
2024-03-15 14:17:25 +03:00
$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();
2024-03-15 16:56:03 +03:00
$activeForm = new \itguild\forms\ActiveForm();
$activeForm->field(class: TextInput::class, name: 'nnn', params: ["style" => "color:RED;display:flex"])
->setLabel("dfdfdffd")
->render();
$activeForm->field(class: TextInput::class, name: 'bbb', params: [])
->setLabel("bbbbbb")
->render();
$activeForm->field(class: Radio::class, name: 'nameee',params: ["style" => "color:RED;display:flex"])
2024-03-18 11:07:09 +03:00
->setOptions(['1' => 'bbb1', '2' => 'vvv3', 3 => 'ggg3', 4 => 'fgfgfgfg4'])
2024-03-15 17:54:06 +03:00
->render();
$activeForm->field(class: Radio::class, name: 'nameee',params: ["style" => "color:RED;display:flex"])
->render();
$activeForm->field(\itguild\forms\inputs\Select::class, 'ddd', ['value' => 2])
->setOptions(['1' => 'bbb1', '2' => 'vvv3', 3 => 'ggg3', 4 => 'fgfgfgfg4'])
2024-03-15 16:56:03 +03:00
->render();