Share » Forums » Developer » how to set value of array item?

how to set value of array item?

how to set value of array item?

Tuesday 10 October 2006 5:00:16 am - 4 replies

Author Message

Paul Forsyth

Tuesday 10 October 2006 5:07:58 am

The last i tried this couldnt get this to work.

Instead I found i had to remove/append the item to make it set, which is horrible.

Paul

Vytautas Germanavičius

Tuesday 10 October 2006 6:01:05 am

Should i fill fearture request form?

Because to replace several itmes in big array with remove/append is too much time consuming.

At the moment, i use my own written operator... I'm not sure that this is best way...

{set-block scope=root variable=cache_ttl}0{/set-block}

Marius Eliassen

Tuesday 10 October 2006 6:25:07 am

You can try something like

{set $items=$items|remove( 0,1 )|insert( 0,100 )}

Claudia Kosny

Wednesday 11 October 2006 12:37:14 am

Hello vytis

an enhancement request sounds like a good idea to me. For the moment I use my own array operators as well and they work fine.

Greetings from Luxembourg

Claudia

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

36 542 Users on board!

Forums menu