Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty assign problem 3.0.8

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
postaczech
Smarty Rookie


Joined: 16 Mar 2011
Posts: 6

PostPosted: Tue Aug 16, 2011 6:01 am    Post subject: Smarty assign problem 3.0.8 Reply with quote

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 Sad

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP