企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
* [ ] 获取设置参数 ``` obtain($Name = null, $Default = null); ``` Name(string|array):参数名称 (支持字符串获取数组) Default:参数不存在时的默认内容 ***** ``` <?php class index { use \TempLets; //使用模板类要使用use引入 public function main() { $this->assign(['usera'=>1,'name'=>'admin']); $this->assign('a.b.c','数组创建');//创建了数组:['a'=>'b'=>['c'=>'数组创建']] $this->assign('username','administrator'); $this->assign('arr',['a'=>['b'=>['c']=>'多维数组']]); echo $this->obtain('usera');//输出:1 echo $this->obtain('name');//输出:admin ps($this->obtain('a')) ;//输出:['b'=>['c'=>'数组创建']] echo $this->obtain('username');//输出:administrator ps($this->obtain('arr.a.b.c')); //输出:多维数组 } } ```