TestAction.class.php

的edit方法中

$this->assign('list',array('one'=>'a','two'=>'b'));

后,在edit.html模板中

可以直接{$list.one}使用,而不用经过像volist标签输出。

原因在ThinkTemplate.class.php的类中load函数中的一个表达式,

extract($templateVar, EXTR_OVERWRITE);  

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
  • 2021-05-26
  • 2021-08-14
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2021-12-24
  • 2021-11-23
  • 2021-12-24
  • 2021-07-22
  • 2022-12-23
相关资源
相似解决方案