You are here: Re: [SMARTY] php function call « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] php function call

Posted by "messju mohr" on 09/30/03 11:22

On Tue, Jul 26, 2005 at 01:39:14PM -0700, JM wrote:
> Ok I have a group of Smarty variable assignments that I want to put in
> a php function so I can call it at various points in the script.
> However, it's not returning any data when I call the function. Any
> ideas?
>
> <?php
> function meat($obj)

if this is php4 you have to pass $obj by reference:
function meat(&$obj)

HTH
messju

> {
> $obj->assign('template_var1', $var1);
> $obj->assign('template_var2', $var2);
>
> return $obj;
> }
>
> // Smarty setup and object blah blah
>
> $template = "page.htm";
> $var1 = "yes";
> $var2 = "no";
>
> meat($obj);
>
> $smarty->display($template);
>
> ?>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация