meraproject/vendor/modulebz/form/example/index.php
keboss-m 5c21d25d45 Initial commit: Merakomis portal, Docker stack and user-reader API.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:04:05 +03:00

51 lines
1.4 KiB
PHP

<?php
use ModuleBZ\Form;
use ModuleBZ\Form\Input\Checkbox;
use ModuleBZ\Form\Input\ColorPicker;
use ModuleBZ\Form\Input\ImagePicker;
use ModuleBZ\Form\Input\Text;
use ModuleBZ\Layout\Row;
use \ModuleBZ\Layout\Column;
use \ModuleBZ\Layout\Title;
include_once("../vendor/autoload.php");
$form = (new Form())
->setValues(['a'=>'b'])
->addRow(
(new Row())
->addColumn(
(new Text())
->setValue('Hello')
->setName('text')
->setPlaceholder('Введите текст')
)
->addColumn(
(new Checkbox())
->setValue('Hello')
->setName('text')
->setPlaceholder('Введите текст')
->setChecked(true)
)
->addColumn(
(new ImagePicker())
->setValue('Hello')
->setName('text')
->setPlaceholder('Введите текст')
->setUploadUrl('asdasd')
)
->addColumn(
(new ColorPicker())
->setValue('#fff00000')
->setName('text')
->setPlaceholder('Введите текст')
)
//->addColumn( (new Column())->addTitle(new Title('Дарова'))->setAllClass('c-1-3') )
//->addColumn( (new Column())->setAllClass('c-1-3')->addInput(new Form\Input()) )
)
;
echo '<pre>';
var_dump($form->toJSON());
echo '</pre>';