Smarty PHP html
Code in PHP:
Include ("global.php");
$name []=array ("Name" = "News");
$name []=array ("Name" = "News 2");
$title = "php100";
$smarty->assign ("title", $title);
$smarty->assign ("name", $name);
$smarty->display ("index.htm");
?>
HTM in code
{$title}
{Section name=list,loop= $name}
{$name [List].name}
{/SECTIOM}
If only the reference title can be called Normally, the loop will error
Error message:
Fatal error:uncaught-Smarty compiler:syntax Error in template ". \templates\index.htm" on line 4 "{Section Name=li st,loop= $name} "Missing" loop "attribute <--thrown in D:\wamp\www\class\smarty\sysplugins\smarty_internal_ templatecompilerbase.php on line 4
Reply to discussion (solution)
{section name=sn loop= $news}
The middle is a space, not a comma
{section name=sn loop= $news}
The middle is a space, not a comma
{section name=list loop= $name}
Useless, then {section name=list loop= $name}
{$name [List].name}
{/sectiom} three lines below are yellow wavy
{Section name=list,loop= $name} {$name [List].name} {/section}
section, you spelled it wrong, not sectiom.
{section name=list loop= $name} {$name [List].name} {/section}
It's supposed to be.
The pit daddy has the wood to have ~ ~
Thank you