2.4.2 and 2.3.0 incompatibilities
| From: | Carsten Bleek | Date: | Thu, 13 Feb 2003 12:09:41 +0000 |
| Subject: | 2.4.2 and 2.3.0 incompatibilities | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-685@lists.php.net to get a copy of this message | ||
(second try, with correct sender)
Hi,
I´ve tried to upgrade to 2.4.2 but had to switch back
to 2.3.0 because of some incompatibilities.
Also its documented not to use quotes I want to point this out.
{include file=$page["template"]["content"]}
produces the following PHP:
$this->_smarty_include($this->_tpl_vars['page']."["template"]["content"]",
array());
which causes a parse error:
Solution is to remove the quites like
{include file=$page[template][content]}
There seems to be annother problem with the scope of variables
in included templates. I´ve attached a small archiv containing
all needed files to reproduce the errro:
The following 2 templates:
1. cat generic.tpl
------------------
Description=<b>{$page.description}<b><br>
{include file=$page[template][content]}
2. cat include.tpl
------------------
Content:= <b> {page.content} </b>
accessed with the following PHP code:
-------------------------------------
$page["template"]["content"]="include.tpl";
$page["description"]="description";
$smarty=new Smarty_OpenHR;
$smarty->assign("page",$page);
$smarty->display('generic.tpl');
is resulting into the folloing compiled PHP code
-------------------------------------------------
<?php /* Smarty version 2.4.2, created on 2003-02-13 13:01:02
compiled from generic.tpl */ ?>Description=<b><?php echo $this->_tpl_vars['page']['description']; ?> <b><br> <?php $_smarty_tpl_vars = $this->_tpl_vars; $this->_smarty_include($this->_tpl_vars['page'][$this->_sections['template']['index']][$this->_sections['content']['index']] $this->_tpl_vars = $_smarty_tpl_vars; unset($_smarty_tpl_vars); ?> which produces the following (browser) output: ---------------------------------------------- Description=description Warning: Smarty error: unable to read template resource: "" in /home/carsten/public_html/jobs/lib/Smarty/Smarty.class.php on line 999 ?> -- ----------------------------------------------- Carsten Bleek - http://www.bleek.de -----------------------------------------------