Object reference issue
| From: | Todd Siegel | Date: | Thu, 20 Oct 2005 15:10:35 +0000 |
| Subject: | Object reference issue | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-13101@lists.php.net to get a copy of this message | ||
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