Home  >  Article  >  Backend Development  >  smarty中括号语法有关问题

smarty中括号语法有关问题

WBOY
WBOYOriginal
2016-06-13 13:15:551113browse

smarty中括号语法问题
 
错误
 {$data["bank_data"]["Arrangement"]["id"]} 

PHP (5.3.9) ERROR (E_USER_ERROR):
File: Smarty.class.php
Line: 1092
Type: Smarty error: [in tke-g-admin_scopeofwork.tpl line 10]: syntax error: unrecognized tag: $data["bank_data"]["Arrangement"]["id"] (Smarty_Compiler.class.php, line 446)
正确
 {$data.bank_data.Arrangement.id} 

第一个为什么错误呢 ?

------解决方案--------------------
Smarty 就是这么约定的!没有为什么
------解决方案--------------------

------解决方案--------------------
确定?这样试试:

PHP code

$arr = array("a"=>array(1,2,3),"b"=>array("c"=>array("d"=>array("e"=>"Tom","f"=>"BeiJing"))));
 $smarty->assign("A",$arr);
 $smarty->display("testTwo.html"); <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn