3.2 explode operator

3.2 explode operator

Thursday 11 September 2003 7:39:45 am - 6 replies

Author Message

Gunnstein Lye

Thursday 11 September 2003 9:05:59 am

The explode operator is for arrays, not strings. Use it to split an array into two arrays. The input value must be an array, and the argument is an integer which specifies the split point. It returns an array containing the two resulting arrays.

It seems you have to use the template.ini approach.

Paul Borgermans

Thursday 11 September 2003 10:40:32 am

So the docs are wrong?

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

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Bruce Morrison

Thursday 11 September 2003 3:57:57 pm

After having a look at the code, the explode operator takes an offset and returns 2 arrays. The first array is an array of elements up to the offset and the second is the elements from the offset to the end. This is quite different to what is documented (as Paul has pointed out)

The documentation at http://ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/operators/array_handling indicates that many of the functions should be able to take both arrays and strings. From looking at the code at lib/eztemplate/classes/eztemplatearrayoperator.php this is not the case.

I think it is an excellent idea to produce documentation before the coding is done. That way it's done and the coders have something to work off and we don't end up in the situation where we are now (limited documentation).

One can only assume that these functions will be completed before the final release.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Gunnstein Lye

Friday 12 September 2003 1:48:14 am

Yes, it seems the docs are wrong. I'll bug the others about this, we'll get it fixed before the release or change the docs.

Gunnstein Lye

Friday 12 September 2003 3:00:50 am

It was fixed yesterday, in fact. String support for explode has been added to svn and will be in the release. I'll see to that the docs are updated.

Paul Forsyth

Friday 12 September 2003 3:39:53 am

Lovely. Thanks.

Paul

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.