"delete" Snippets


View "miva_array_delete() within mvt:foreach"
<h1>miva_array_delete() within mvt:foreach</h1> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[4]" value="'Cereal'" /> <h4>Before:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" /> <mvt:foreach iterator="item" array="example:list"> <mvt:if expr="l.settings:item EQ 'Milk'"> <mvt:assign name="l.result" value="miva_array_delete( l.settings:example:list, l.POS1, 1 )" /> </mvt:if> </mvt:foreach> <h4>After:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Basket #19555

Example of Miva_array_Delete
Created: 1468365919
View "Basket #19555"
<mvt:assign name="l.settings:my_array" value="miva_array_deserialize( 'one,two,three,four,five,six' )" /> <mvt:eval expr="l.settings:my_array" /> ~~~ <mvt:eval expr="miva_array_delete( l.settings:my_array, 6, 1 )" /> ~~~ <mvt:eval expr="l.settings:my_array" />
 

Miva Array Delete Example

Example of Miva_array_Delete
Created: 1461693242
View "Miva Array Delete Example"
<mvt:assign name="l.settings:my_array" value="miva_array_deserialize( 'one,two,three,four,five,six' )" /> <mvt:eval expr="l.settings:my_array" /> ~~~ <mvt:eval expr="miva_array_delete( l.settings:my_array, 6, 1 )" /> ~~~ <mvt:eval expr="l.settings:my_array" />