Re: [SMARTY] Re: [SMARTY-DEV] Bug: Smarty produces PHP parse error

boots <[email protected]>
Newsgroups gmane.comp.php.smarty.general
Message-ID <[email protected]>
--- Jochem Maas <[email protected]> wrote:
> Ain't no bug here me thinks.
> I'm not a smarty dev - just reasd the list - redirected my reply
> to Smarty general because I believe your problem is not down to a bug
> in smarty.


it is a parse error but not a bug -- rather, an unsupported syntax.



> Sebastian Haller wrote:
> > I get a parse error, when i use smarty. To reproduce, you can take
> the demo
> > (which comes with smarty) and add the following files:
> > 
> > -- debug.php
> > <?php
> > 
> > require '../libs/Smarty.class.php';
> > 
> > $smarty = new Smarty;
> > 
> > $smarty->compile_check = true;
> > $smarty->debugging = true;
> > 
> > $smarty->assign("array",array("Doe","Smith","Johnson","Case"));
> > 
> > $smarty->assign("j",1);
> > 
> > $smarty->display('debug.tpl');
> > 
> > ?>
> > 
> > -- debug.tpl
> > {if $tree[$j] or $tree[$j-1]}
> 
> that should be something like?:
> 
> {if $tree.$j or $tree.`$j-1`}


should actually be something like (or equivalent using {math}):
{assign var=k value=$j-1}
{if $tree[$j] or $tree[$k]}



> regardless, where the bleep is $tree coming from?
> you assign the array as the name 'array' (which is madness if you ask
> me
> and asking for trouble), maybe the assign line should read?:
> 
> $smarty->assign("tree",array("Doe","Smith","Johnson","Case"));
> 
> > a
> > {/if}
> > 
> > -- error produced
> > Parse error: parse error in
> >
>
/www/dev/sebastian/www/smarty/demo/templates_c/%%6B^6B7^6B774C3E%%debug.tpl.
> > php on line 3



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

-- 
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.