Let, Set, Section Problem!

Author Message

Phi Hoang

Monday 24 November 2003 1:31:31 am

This is a simple code:

{let a=1}
{section name=Index loop=5}
{set a=10}
{$a}<br>
{/section}
{/let}

========>result:
1
1
1
1
1

But:
{let a=1}
{set a=10}
{section name=Index loop=5}
{$a}<br>
{/section}
{/let}
=======>result:
10
10
10
10
10

I don't know why two above results are different?
Thanks,
Phi

Paul Forsyth

Monday 24 November 2003 1:57:58 am

Read this document:

http://ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/basics/namespaces_

You are using your variables in difference namespaces, where they are different.

Paul

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 19 2025 03:42:40
Script start
Timing: Jan 19 2025 03:42:40
Module start 'layout'
Timing: Jan 19 2025 03:42:40
Module start 'content'
Timing: Jan 19 2025 03:42:41
Module end 'content'
Timing: Jan 19 2025 03:42:41
Script end

Main resources:

Total runtime1.0589 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.0086 589.1484152.6250
Module start 'layout' 0.00860.0041 741.773439.4453
Module start 'content' 0.01281.0438 781.2188462.7656
Module end 'content' 1.05660.0022 1,243.98448.1641
Script end 1.0588  1,252.1484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.3557160.0002
Check MTime0.00170.1611160.0001
Mysql Total
Database connection0.00230.219710.0023
Mysqli_queries1.009495.3292540.0187
Looping result0.00050.0456520.0000
Template Total1.017896.120.5089
Template load0.00240.229020.0012
Template processing1.015495.891920.5077
Template load and register function0.00020.020910.0002
states
state_id_array0.00090.086010.0009
state_identifier_array0.00290.270820.0014
Override
Cache load0.00180.1695370.0000
Sytem overhead
Fetch class attribute can translate value0.00050.048720.0003
Fetch class attribute name0.00130.119020.0006
XML
Image XML parsing0.00020.021320.0001
class_abstraction
Instantiating content class attribute0.00000.000520.0000
General
dbfile0.00070.0695100.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs