Forums / General / Naming Convention

Naming Convention

Author Message

Softriva .com

Monday 28 August 2006 10:14:39 am

I am starting to get confused about naming my templates and variables.

How do you guys/gals name your templates and variables. Is there a naming convention for naming templates and variables?

OOzy

Christian Johansen

Tuesday 29 August 2006 11:46:48 pm

I put my templates in hierarchies and give them names reflecting the class and if nescessary section or other override criteria. Example:

override/templates:

node/view/full/folder.tpl
node/view/full/news_folder.tpl
node/view/line/folder.tpl
content/datatype/ezstring.tpl

and so on. As for variables I stick to the underscore style of writing names that is used mostly throughout eZ: $date_created and so on.

Pascal von Büren

Wednesday 30 August 2006 12:49:35 am

Hi there,

same goes here for folders and variables.
Additionally, there is a coding standards guide on ez.no for both template language and php:

<b>Template Standards</b>
http://ez.no/ez_publish/documentation/development/standards/template

<b>PHP Standards</b>
http://ez.no/ez_publish/documentation/development/standards/template

Greetings,

Pascal

eZ debug

Timing: Jan 18 2025 20:56:07
Script start
Timing: Jan 18 2025 20:56:07
Module start 'content'
Timing: Jan 18 2025 20:56:07
Module end 'content'
Timing: Jan 18 2025 20:56:07
Script end

Main resources:

Total runtime0.5800 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.5859180.8516
Module start 'content' 0.00640.5643 768.4375543.9453
Module end 'content' 0.57070.0092 1,312.382842.4453
Script end 0.5799  1,354.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.5505140.0002
Check MTime0.00150.2548140.0001
Mysql Total
Database connection0.00140.236010.0014
Mysqli_queries0.530891.5145600.0088
Looping result0.00070.1230580.0000
Template Total0.555395.720.2777
Template load0.00210.368420.0011
Template processing0.553295.371820.2766
Template load and register function0.00020.039810.0002
states
state_id_array0.00090.162810.0009
state_identifier_array0.00070.128920.0004
Override
Cache load0.00180.3071250.0001
Sytem overhead
Fetch class attribute can translate value0.00070.120030.0002
Fetch class attribute name0.00110.190640.0003
XML
Image XML parsing0.00280.486430.0009
class_abstraction
Instantiating content class attribute0.00000.001740.0000
General
dbfile0.00731.2546170.0004
String conversion0.00000.000930.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs