New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with {if="test"}0{/if} #38

Closed
tontof opened this Issue Oct 1, 2013 · 6 comments

Comments

Projects
None yet
3 participants
@tontof

tontof commented Oct 1, 2013

I don't know why

{if="$number==10"}1{else}NO!{/if}

works but

{if="$number==10"}0{else}NO!{/if}

and

{if="$number==10"}0{/if}

do not work

Fatal error: Uncaught exception 'RainTpl_SyntaxException' with message 'Error! You need to close an {if} tag

Just encounter the problem with 0

if I add a new line after it, it works

{if="$number==10"}0
{/if}
@tontof

This comment has been minimized.

Show comment
Hide comment
@tontof

tontof Oct 1, 2013

Same problem after {else} with 0

{if="$number==10"}NO{else}1{/if}

works but

{if="$number==10"}NO{else}0{/if}

does not work

tontof commented Oct 1, 2013

Same problem after {else} with 0

{if="$number==10"}NO{else}1{/if}

works but

{if="$number==10"}NO{else}0{/if}

does not work

@eliemichel

This comment has been minimized.

Show comment
Hide comment
@eliemichel

eliemichel Sep 1, 2014

Contributor

Cannot reproduce the bug. {if="$number==10"}0{/if} works well for me.
Could you provide a full example?

Contributor

eliemichel commented Sep 1, 2014

Cannot reproduce the bug. {if="$number==10"}0{/if} works well for me.
Could you provide a full example?

@tontof

This comment has been minimized.

Show comment
Hide comment
@tontof

tontof Sep 1, 2014

<?php                                                                         
include "rain.tpl.class.php"; //include Rain TPL                              
raintpl::$tpl_dir = "tpl/"; // template directory                             
raintpl::$cache_dir = "tmp/"; // cache directory                              

$tpl = new raintpl(); //include Rain TPL                                      
$tpl->assign( "number", "30" ); // assign variable                            
$tpl->draw( "test" ); // draw the template                                    

with template in tpl/test.html

{if="$number==10"}0{/if}

I've got with php PHP 5.4.4-14+deb7u14

Fatal error: Uncaught exception 'RainTpl_SyntaxException' with message 'Error! You need to close an {if} tag in tpl/test.html template' in rain.tpl.class.php:580
Stack trace:                                                                  
#0 rain.tpl.class.php(361): RainTPL-&gt;compileCode(Array)                    
#1 rain.tpl.class.php(310): RainTPL-&gt;compileTemplate('{if=&quot;$number==1\
...', NULL)                                                                   
#2 rain.tpl.class.php(274): RainTPL-&gt;compileFile('test', NULL, 'tpl/test.h\
tml', 'tmp/', 'tmp/test.af3906...')                                           
#3 rain.tpl.class.php(164): RainTPL-&gt;check_template('test')                
#4 index.php(8): RainTPL-&gt;draw('test')                                     
#5 {main}                                                                     
  thrown in rain.tpl.class.php on line 580

edit: with last version of raintpl 2.7.2

tontof commented Sep 1, 2014

<?php                                                                         
include "rain.tpl.class.php"; //include Rain TPL                              
raintpl::$tpl_dir = "tpl/"; // template directory                             
raintpl::$cache_dir = "tmp/"; // cache directory                              

$tpl = new raintpl(); //include Rain TPL                                      
$tpl->assign( "number", "30" ); // assign variable                            
$tpl->draw( "test" ); // draw the template                                    

with template in tpl/test.html

{if="$number==10"}0{/if}

I've got with php PHP 5.4.4-14+deb7u14

Fatal error: Uncaught exception 'RainTpl_SyntaxException' with message 'Error! You need to close an {if} tag in tpl/test.html template' in rain.tpl.class.php:580
Stack trace:                                                                  
#0 rain.tpl.class.php(361): RainTPL-&gt;compileCode(Array)                    
#1 rain.tpl.class.php(310): RainTPL-&gt;compileTemplate('{if=&quot;$number==1\
...', NULL)                                                                   
#2 rain.tpl.class.php(274): RainTPL-&gt;compileFile('test', NULL, 'tpl/test.h\
tml', 'tmp/', 'tmp/test.af3906...')                                           
#3 rain.tpl.class.php(164): RainTPL-&gt;check_template('test')                
#4 index.php(8): RainTPL-&gt;draw('test')                                     
#5 {main}                                                                     
  thrown in rain.tpl.class.php on line 580

edit: with last version of raintpl 2.7.2

@eliemichel

This comment has been minimized.

Show comment
Hide comment
@eliemichel

eliemichel Sep 5, 2014

Contributor

Tested with the exact same version (and with PHP 5.5.15 too), and no problem.
So I believe the problem comes from somewhere in your php.ini file or so.

Contributor

eliemichel commented Sep 5, 2014

Tested with the exact same version (and with PHP 5.5.15 too), and no problem.
So I believe the problem comes from somewhere in your php.ini file or so.

@tontof

This comment has been minimized.

Show comment
Hide comment
@tontof

tontof Sep 7, 2014

Hey, the 2.7.2 has changed since I've dowloaded it.
I've just updated it with new master version on github and it works now.
Thanks for your test confirmation !

tontof commented Sep 7, 2014

Hey, the 2.7.2 has changed since I've dowloaded it.
I've just updated it with new master version on github and it works now.
Thanks for your test confirmation !

@tontof tontof closed this Sep 7, 2014

@feulf

This comment has been minimized.

Show comment
Hide comment
@feulf

feulf Sep 7, 2014

Owner

Great. Well master is not 2.7.2, master is the dev version, which is the
most updated always. I'll create a new tag for the new updates.

Thanks

On Sun, Sep 7, 2014 at 12:06 PM, tontof notifications@github.com wrote:

Hey, the 2.7.2 has changed since I've dowloaded it.
I've just updated it with new master version on github and it works now.


Reply to this email directly or view it on GitHub
#38 (comment).

Owner

feulf commented Sep 7, 2014

Great. Well master is not 2.7.2, master is the dev version, which is the
most updated always. I'll create a new tag for the new updates.

Thanks

On Sun, Sep 7, 2014 at 12:06 PM, tontof notifications@github.com wrote:

Hey, the 2.7.2 has changed since I've dowloaded it.
I've just updated it with new master version on github and it works now.


Reply to this email directly or view it on GitHub
#38 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment