32 lines
563 B
PHP
32 lines
563 B
PHP
![]() |
<?php
|
||
|
|
||
|
namespace itguild\forms;
|
||
|
|
||
|
use itguild\forms\debug\Debug;
|
||
|
use itguild\forms\inputs\BaseInput;
|
||
|
|
||
|
class ActiveForm
|
||
|
{
|
||
|
private BaseInput $fieldObject;
|
||
|
|
||
|
public function field($class, string $name, array $params = [])
|
||
|
{
|
||
|
$this->fieldObject = new $class($name, $params);
|
||
|
$this->fieldObject->create();
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function setLabel(string $title)
|
||
|
{
|
||
|
$this->fieldObject->setLabel($title);
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function render()
|
||
|
{
|
||
|
$this->fieldObject->render();
|
||
|
}
|
||
|
|
||
|
}
|