Forums / Setup & design / quotes

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

eZ debug

Timing: Jan 18 2025 15:51:17
Script start
Timing: Jan 18 2025 15:51:17
Module start 'content'
Timing: Jan 18 2025 15:51:17
Module end 'content'
Timing: Jan 18 2025 15:51:18
Script end

Main resources:

Total runtime0.8921 sec
Peak memory usage4,096.0000 KB
Database Queries210

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 588.6484180.8594
Module start 'content' 0.00720.7421 769.5078687.2031
Module end 'content' 0.74930.1427 1,456.7109341.7188
Script end 0.8920  1,798.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4697210.0002
Check MTime0.00160.1782210.0001
Mysql Total
Database connection0.00090.095410.0009
Mysqli_queries0.798889.54302100.0038
Looping result0.00240.26382080.0000
Template Total0.860396.420.4301
Template load0.00200.227520.0010
Template processing0.858296.203220.4291
Template load and register function0.00010.013310.0001
states
state_id_array0.00120.130710.0012
state_identifier_array0.00080.085820.0004
Override
Cache load0.00180.2044440.0000
Sytem overhead
Fetch class attribute can translate value0.00120.138650.0002
Fetch class attribute name0.00100.1101110.0001
XML
Image XML parsing0.00190.215650.0004
class_abstraction
Instantiating content class attribute0.00000.0027140.0000
General
dbfile0.01001.1213480.0002
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 33
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs