Home  >  Article  >  Backend Development  >  php中smarty关于section循环有关问题

php中smarty关于section循环有关问题

WBOY
WBOYOriginal
2016-06-13 11:49:59735browse

php中smarty关于section循环问题
{yun:}section name="menu" loop=$navigation{/yun}
  {yun:}assign var="one_menu_id" value=$navigation[menu].id{/yun}
  

 
   {yun:}section name="menud" loop=$one_menu[$one_menu_id]{/yun}
     {yun:}assign var="two_menu_rows" value=$one_menu[$one_menu_id]{/yun}
     {yun:}assign var="two_menu_id" value=$one_menu[$one_menu_id][menud].id{/yun}




红色标注的是几个意思?smarty中有这种写法??
------解决方案--------------------
Smarty手册里面有的 好好找找
1、assign

定义一个模板变量并赋值

格式:
------解决方案--------------------
{assign}用于在模板运行期间赋值给变量. 
http://www.smarty.net/docs/zh_CN/language.function.assign.tpl
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