初始化仓库
This commit is contained in:
38
admin/components/UI/Node.php
Normal file
38
admin/components/UI/Node.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace admin\components\UI;
|
||||
|
||||
use admin\components\UI\Node\NodeEl;
|
||||
|
||||
/**
|
||||
* node 生成工具
|
||||
*/
|
||||
class Node
|
||||
{
|
||||
|
||||
public array $nodes = [];
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function render(): array
|
||||
{
|
||||
$data = [];
|
||||
foreach ($this->nodes as $vo) {
|
||||
$data[] = $vo->render();
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $method
|
||||
* @param $arguments
|
||||
* @return NodeEl
|
||||
*/
|
||||
public function __call($method, $arguments)
|
||||
{
|
||||
$nodeEl = new NodeEl($method, $arguments[0]);
|
||||
$this->nodes[] = $nodeEl;
|
||||
return $nodeEl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user