Best practice for handling keys in $view_parameters

Author Message

Lars Eirik R

Friday 06 May 2011 2:02:29 am

Hi. I need to check if my $view_parameters contains a given key. What is the best approach for doing this without getting any warnings in my log.

Could someone verify that is_set is the right way? seems to work

Ivo Lukac

Friday 06 May 2011 2:50:14 am

Yes:

{if is_set($view_parameters.foo)}

{/if}

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

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 01:59:00
Script start
Timing: Jan 18 2025 01:59:00
Module start 'layout'
Timing: Jan 18 2025 01:59:00
Module start 'content'
Timing: Jan 18 2025 01:59:01
Module end 'content'
Timing: Jan 18 2025 01:59:01
Script end

Main resources:

Total runtime1.2759 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.0469152.6406
Module start 'layout' 0.00640.0036 740.687539.5000
Module start 'content' 0.01011.2645 780.1875528.7031
Module end 'content' 1.27450.0014 1,308.89068.1250
Script end 1.2759  1,317.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2614160.0002
Check MTime0.00140.1066160.0001
Mysql Total
Database connection0.00100.077010.0010
Mysqli_queries1.224095.9258540.0227
Looping result0.00050.0414520.0000
Template Total1.230096.420.6150
Template load0.00200.157920.0010
Template processing1.228096.240820.6140
Template load and register function0.00010.006610.0001
states
state_id_array0.00130.100910.0013
state_identifier_array0.00180.137720.0009
Override
Cache load0.00160.1247110.0001
Sytem overhead
Fetch class attribute can translate value0.00080.060920.0004
Fetch class attribute name0.00150.120840.0004
XML
Image XML parsing0.00100.077420.0005
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00140.1073230.0001
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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs