Forums / Developer / Howto show content of an array

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Howto show content of an array

Author Message

Shurbann Martes

Sunday 11 January 2004 6:53:11 am

Hello,

How can I show the content of an array?

-Shurbann

Shurbann Martes

Thursday 15 January 2004 2:08:44 am

Are there no way of showing the content of an array?

[code]

{let test=array(1,2,3) }
{$test}

[/code]

This one won't work cause, the ouptut will only show that this is an array. Is there a method that show what's inside the array?

-Shurbann

James Packham

Thursday 15 January 2004 2:52:14 am

$test[0] will show you the first value, $test[1] the second... etc

Or you can find out what the array contains by using

{$test|attribute(show)} you can change the depth it shows like this {$test|attribute(show,1)} for 1 level deep, {$test|attribute(show,2)} for two levels deep..... etc

You can find more about arrays here:

http://www.ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/operators/array_handling

Regards,

~James~