|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
postaczech Smarty Rookie
Joined: 16 Mar 2011 Posts: 6
|
Posted: Tue Aug 16, 2011 6:01 am Post subject: Smarty assign problem 3.0.8 |
|
|
Hi, I have problem. I have follow php code:
<?php
class li {
function create($li)
{ $this->li = "<li>$li</li>";
return print $this->li;
}
}
$new_li = new li();
$new_li->create("O nás");
$new_li->create("Reference");
$new_li->create("Služby");
$new_li->create("Kontakty");
require_once '../libs/smarty/Smarty.class.php';
$smarty = new Smarty;
$smarty->assign("item1",$item1);
$smarty->assign("item2",$item2);
$smarty->assign("item3",$item3);
$smarty->assign("item4",$item4);
?>
and I need assign item1,item2,item3,item4 to template menu.tpl, but I can't assign like object and I dont know why
I have this code in menu.tpl:
<div class="menu grid_16">
<ul>
{$item1}
{$item2}
{$item3}
{$item4}
</ul>
</div>
Can you help me with this solve problem? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|