初始化仓库
This commit is contained in:
35
admin/components/UI/Form/Layout.php
Normal file
35
admin/components/UI/Form/Layout.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace admin\components\UI\Form;
|
||||
|
||||
/**
|
||||
* Class Row
|
||||
* @package backend\components\UI\Table
|
||||
*/
|
||||
class Layout extends Composite implements Component
|
||||
{
|
||||
protected $callback;
|
||||
|
||||
/**
|
||||
* @param callable|array $callback
|
||||
*/
|
||||
public function __construct($callback)
|
||||
{
|
||||
$this->callback = $callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function render(): array
|
||||
{
|
||||
$callback = is_callable($this->callback) ? call_user_func($this->callback) : $this->callback;
|
||||
return [
|
||||
'nodeName' => 'div',
|
||||
'class' => 'mb-4',
|
||||
'child' => $callback
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user