quotes

Author Message

Marko Žmak

Saturday 16 October 2004 7:20:24 am

What's the difference between single and double quotes in EZ templates?

Is it the same way as in PHP?

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

Hubert Farnsworth

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

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

eZ debug

Timing: Jan 18 2025 19:07:47
Script start
Timing: Jan 18 2025 19:07:47
Module start 'layout'
Timing: Jan 18 2025 19:07:47
Module start 'content'
Timing: Jan 18 2025 19:07:47
Module end 'content'
Timing: Jan 18 2025 19:07:47
Script end

Main resources:

Total runtime0.8108 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.9141152.6094
Module start 'layout' 0.00480.0024 741.523439.3984
Module start 'content' 0.00720.8014 780.9219682.1484
Module end 'content' 0.80860.0022 1,463.070320.8359
Script end 0.8108  1,483.9063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3720160.0002
Check MTime0.00130.1571160.0001
Mysql Total
Database connection0.00080.095710.0008
Mysqli_queries0.738891.1219730.0101
Looping result0.00100.1288710.0000
Template Total0.780696.320.3903
Template load0.00220.265920.0011
Template processing0.778495.996620.3892
Template load and register function0.00010.014710.0001
states
state_id_array0.00100.126410.0010
state_identifier_array0.00200.243420.0010
Override
Cache load0.00190.2341440.0000
Sytem overhead
Fetch class attribute can translate value0.00080.093740.0002
Fetch class attribute name0.00200.2468110.0002
XML
Image XML parsing0.00180.227840.0005
class_abstraction
Instantiating content class attribute0.00000.0033140.0000
General
dbfile0.00110.1318370.0000
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 33
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs