[SMARTY] Object reference issue

Todd Siegel <[email protected]>
Newsgroups gmane.comp.php.smarty.general
Message-ID <[email protected]>
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

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.