Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Smarty 3.0 RC1: Case sensitivity for tags

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
ollisso
Smarty n00b


Joined: 11 May 2010
Posts: 3

PostPosted: Tue May 11, 2010 8:21 pm    Post subject: Smarty 3.0 RC1: Case sensitivity for tags Reply with quote

Hello,

Currently trying to start using templates and selected Smarty as tempalte engine.

First problem that I found is that tags are case sensitive.

For example:
{PAGE key=harbour}
and
{page key=harbour}
are completely different functions under Linux, but same under Windows.

Under Linux I get following error:
Code:

<b>Fatal error</b>:  Uncaught exception 'Exception' with message 'Syntax Error in template "skins/../skin/harbour_front.tpl"  on line 1 "{PAGE key=harbour}
" unknown tag "page"' in external/smarty/sysplugins/smarty_internal_templatecompilerbase.php:425
Stack trace:
#0 external/smarty/sysplugins/smarty_internal_templatecompilerbase.php(222): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "pa...', 1)
#1 external/smarty/sysplugins/smarty_internal_templateparser.php(2044): Smarty_Internal_TemplateCompilerBase->compileTag('PAGE', Array)
#2 external/smarty/sysplugins/smarty_internal_templateparser.php(2451): Smarty_Internal_Templateparser->yy_r31()
#3 external/smarty/sysplugins/smarty_internal_templateparser.php(2551): Smarty_Internal_Templateparser->yy_reduce(31)
#4 ... in <b>external/smarty/sysplugins/smarty_internal_templatecompilerbase.php</b> on line <b>425</b>


Should it be fixed to strtolower everything, at least for functions/blocks/etc. ?

(can't imagine situation where one might need to have functiosn like PAGE, page, Page, PaGe, etc)



[/i]
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed May 12, 2010 6:58 pm    Post subject: Re: Smarty 3.0 RC1: Case sensitivity for tags Reply with quote

ollisso wrote:

(can't imagine situation where one might need to have functiosn like PAGE, page, Page, PaGe, etc)


can't imagine a situation where one might mean page but type PAGE, Page, or PaGe...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ollisso
Smarty n00b


Joined: 11 May 2010
Posts: 3

PostPosted: Wed May 12, 2010 10:03 pm    Post subject: Reply with quote

As a general rule, it is much more simplier to have standart that designer have to use capitalized for any pseudocodes.

In other words:
Code:

{GROUP}
   long html... for dozens of rows
{/GROUP}

vs

{group}
   long html... for dozens of rows
{/group}

First - version you can easily recognize
Second - hard to distingquish html itself from pseudocodes/functions
Back to top
View user's profile Send private message
ollisso
Smarty n00b


Joined: 11 May 2010
Posts: 3

PostPosted: Wed May 12, 2010 10:06 pm    Post subject: Reply with quote

But problem lies that under windows - there is no problems.

I.e. you can use GROUP and group - it will work correctly.
but under linux - it won't find needed files.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP