初始化仓库
This commit is contained in:
38
admin/components/UI/Widget/Form.php
Normal file
38
admin/components/UI/Widget/Form.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace admin\components\UI\Widget;
|
||||
|
||||
/**
|
||||
* Class Form
|
||||
* @package backend\components\UI\Widget
|
||||
*/
|
||||
class Form extends Widget
|
||||
{
|
||||
|
||||
private \backend\components\UI\Form $form;
|
||||
|
||||
public function __construct($data, callable $callback = null)
|
||||
{
|
||||
$this->callback = $callback;
|
||||
$this->form = new \backend\components\UI\Form($data, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function render(): string
|
||||
{
|
||||
return $this->form->render();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $method
|
||||
* @param $arguments
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($method, $arguments)
|
||||
{
|
||||
return $this->form->$method(...$arguments);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user