Re: [SMARTY] Compatible Template-Arrays for 2.6.0 and 2.4.2?
| From: | messju mohr | Date: | Fri, 16 Jan 2004 22:44:38 +0000 |
| Subject: | Re: [SMARTY] Compatible Template-Arrays for 2.6.0 and 2.4.2? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10835@lists.php.net to get a copy of this message | ||
On Fri, Jan 16, 2004 at 08:21:55PM +0100, messju mohr wrote:
> AFAIR backticks where introduced in 2.5.0 to prevent disambiguities like
>
> {include file="$foo.tpl"}
> (is .tpl a hash-array-index or a file-extension?)
>
> you use a >=2.5.0 with smarty 2.4.2 if you run such templates.
hmrpf. this should read "... a >=2.5.0-feature with smarty 2.4.2 ...",
of course.
> the simplest solution is: upgrade your servers.
>
> if that is not an option the only alternative that comes to my mind
> would be a prefilter that checks $smarty->_version and does a nifty
> preg_replace to eliminate the backticks from the templates source if
> it finds "2.4.2"
>
> but i doubt that employing such a prefilter is less risk and less work
> and less testing than upgrading your 2.4.2 installations.
>
> greetings
> messju
>
> On Fri, Jan 16, 2004 at 08:13:00PM +0100, Matthias Mohr wrote:
> > Is there no solution ? That would be really bad :(
> >
> > Or did nobody read my post?
> >
> > ----- Original Message -----
> > From: "Matthias Mohr" <MMohr@sysdesign-edv.de>
> > To: <smarty-general@lists.php.net>
> > Sent: Wednesday, January 14, 2004 12:37 PM
> > Subject: [SMARTY] Compatible Template-Arrays for 2.6.0 and 2.4.2?
> >
> >
> > > Hi everybody,
> > >
> > > it has been awhile since I wrote something here, but I hope my question has not been
> > > already been answered (couldn't find anything
> > > in the archive)
> > >
> > > After a long time still running Smarty 2.4.2 I decided to update to v2.6.0
> > > For using 2.6.0 I have to surround my array/object accesses with backticks like
> > > follows:
> > > "
$arr[$idx].name"
> > > In 2.4.2 I used the same without backtickst: "$arr[$idx].name"
> > >
> > > I want it to run on both Smarty versions 2.4.2 and 2.6.0
> > > When I now use the 2.6.0-version at a server with smarty 2.4.2 it produces a lot
> > > backticks in my output.
> > > Is there (another) syntax or a workaround which enables me to use the code in both
> > > versions?
> > > (maybe something which detects the version and does something...)
> > >
> > > with regards,
> > > Matthias