quotes

quotes

Saturday 16 October 2004 7:20:24 am - 6 replies

Author Message

Marco Zinn

Saturday 16 October 2004 1:07:26 pm

What do you mean?
I think, you can use both in the template language, if this is your question.

Marco
http://www.hyperroad-design.com

Alex Jones

Monday 18 October 2004 6:39:57 am

That's a good question Marko.

Marco, I think what Marko is asking is, whether eZ publish uses the same set of evaluation procedures for single quotes and double quotes as PHP. Within PHP, a string contained in single quotes will not be evaluated for variables, whereas a string in double-quotes will be evaluated. So, if you have a plain-text string, that has no variables, it is faster to use single quotes for it. If eZ publish's template markup does follow the same pattern, it may well affect rendering speed and whether or not variables are read properly.

Marko, from my experience, I do not think that eZ publish acknowledges any difference between single and double quotes, though someone else may be able to provide a more definitive answer.

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Marco Zinn

Monday 18 October 2004 12:55:41 pm

Hi Alex,
ah, i'm not too much into PHP coding, so i didn't not that.
"Someone else" would probably be from the ezCrew (do they filter forum messages for "ezCrew"? ;) )

Nice subline, btw. Hope, you don't get paranoid with all those Mar[c|k]o's around

Marco
http://www.hyperroad-design.com

Marko Žmak

Tuesday 19 October 2004 9:08:14 am

Yep Alex, that was exactly what I was asking. I'll stick with your opinion until someone gives a "more definite answer".

Thx.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Alex Jones

Tuesday 19 October 2004 9:15:05 am

Cool. I would like to hear a response from eZ systems as well.

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Paul Borgermans

Tuesday 19 October 2004 9:41:35 am

Although I'm not from the ez crew

The bottom line: there is no difference in handling between single or double quotes. Did you try this in some scenario?

I can come up with two "places"

{let} {set} {default} constructs: you cannot put variables in a string, it won't be parsed. Eg

<!--
{let registration_count=12
      string_single = 'single $registration_count'
      string_double = "double $registration_count" }

{$string_single} and {$string_double}
{/let}
-->

Will output the verbatim strings:

<!--
single $registration_count and double $registration_count
-->

Second scenario: when you put variables inside strings like in

<!--
{let registration_count=12}
<p>'Hi there {$registration_count}'</p>
<p>"Hi there {$registration_count}"</p>
-->
{/let}

Will output

<!--
<p>'Hi there 12'</p>
<p>"Hi there 12"</p>
-->

And you cannot nest {}, for example {'Hi there, we've got {$registration_count} registrations'} is illegal (you really do not get what you may think.

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.