You are here: Re: [SMARTY] Object reference issue « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] Object reference issue

Posted by Jochem Maas on 11/04/05 19:27

boots wrote:
> --- Todd Siegel <thsiegel@yahoo.com> wrote:
>
>>I added backticks per the link you sent, but it's still not working.
>>
>>{include file="`$page_info->getRequestedPath()`.tpl"} (and other
>>quote/backtick combinations)
>
>
> Not per the link I sent. That page does not indicate that you can embed
> object method calls. You can however use the cat modifier:
>
> {include file=$page_info->getRequestedPath()|cat:".tpl"}
>
> But why wouldn't the method return the full path including the
> extension so that you can simplify to:
>
> {include file=$page_info->getRequestedPath()}

or possibly:

{include file=$page_info->getRequestedPath('tpl')}

just thinking out loud :-)

>
> ?
>
> See:
> http://smarty.php.net/manual/en/language.modifier.cat.php
>
> HTH
>
> xo boots
>
>
>>yields...
>>
>><?php $_smarty_tpl_vars = $this->_tpl_vars;
>>$this->_smarty_include(array('smarty_include_tpl_file' =>
>>"`".($this->_tpl_vars['page_info'])."->getRequestedPath()`.tpl",
>>'smarty_include_vars' => array()));
>>$this->_tpl_vars = $_smarty_tpl_vars;
>>unset($_smarty_tpl_vars);
>> ?>
>>
>>..and...
>>
>>unable to read resource: "`Object id #2->getRequestedPath()`.tpl"
>>
>>Thanks,
>>Todd
>>
>>--- boots <jayboots@yahoo.com> wrote:
>>
>>
>>>--- pbaker <baker_net@tlen.pl> wrote:
>>>
>>>>if the method returns the name U should assign the name to
>>
>>variable,
>>
>>>>something like this:
>>>>
>>>>{assign var="name" value=$page_info->getRequestedPath()}
>>>>
>>>>and then {include file="$name.tpl"} <--- not tested :P
>>>
>>>uhh, not exactly. This would work, but the real issue is the use of
>>>double quotes when they are not required.
>>>
>>>See:
>>> http://smarty.php.net/manual/en/language.syntax.quotes.php
>>>
>>>xo boots
>
>
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>

 

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

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