dynamic config
This commit is contained in:
33
widgets/ConfigTree.php
Normal file
33
widgets/ConfigTree.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace app\widgets;
|
||||
|
||||
use yii\base\Widget;
|
||||
|
||||
class ConfigTree extends Widget {
|
||||
|
||||
public $configLists;
|
||||
public $isRoot;
|
||||
public $parent_id;
|
||||
public $parent_key;
|
||||
|
||||
public function init() {
|
||||
parent::init();
|
||||
}
|
||||
|
||||
public function run() {
|
||||
|
||||
$public_root = ['engine', 'recognition', 'open_door'];
|
||||
$public_cfg = ['engine|cam_id', 'engine|server_authen', 'recognition|server_recog', 'open_door|enable', 'open_door|port_name'];
|
||||
|
||||
return $this->render("config-tree", [
|
||||
"configLists" => $this->configLists,
|
||||
"isRoot" => $this->isRoot,
|
||||
"parent_id" => $this->parent_id,
|
||||
"parent_key" => $this->parent_key,
|
||||
"public_root" => $public_root,
|
||||
"public_cfg" => $public_cfg
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user