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

Posted by Todd Siegel on 10/20/05 18:10

I've messed with this for a while and can't figure it out.

In my PHP I have:

$smarty->assign_by_ref('page_info', $page_info);

In my template I have...

{if $page_info->getRequestedPath() == "products-services"}
....
{/if}

which compiles into...

<?php if ($this->_tpl_vars['page_info']->getRequestedPath() ==
"products-services"): ?>

...and works fine. Then a few lines later, in the same template, I have:

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

which compiles to...

<?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 does not work.

Obviously I get this in the log:

Smarty error: unable to read resource: "Object id #2->getRequestedPath().tpl"

What's causing this?

Thanks in advance,
Todd

 

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

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