block.assocarray.php
Table of Contents
- smarty_block_assocarray() : mixed
- Smarty {assocarray} block plugin Type: block<br> Name: assocarray<br> Purpose: Set up a associative array Version: 1.1 Author: boots
Functions
smarty_block_assocarray()
Smarty {assocarray} block plugin Type: block<br> Name: assocarray<br> Purpose: Set up a associative array Version: 1.1 Author: boots
smarty_block_assocarray( $params, $content, Smarty &$smarty, &$repeat) : mixed
Parameters
- $params :
- $content :
- $smarty : Smarty
- $repeat :
-
Purpose: make assignments from within a template with a simple syntax supporting multiple assignments and allowing for simple assignments as well as arrays and keyed arrays. See: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=64 Example: {assocarray} test: "test" test2: 10 test3: "this is a test" test4: ["test1", "test2", "test3"] test5: [ key1: $smarty.const.PATH_RELATIVE key2: "value2" ] test6: [ key1: "value1" key2: [ subkey1: $config.passed_value //$config.passed_value is set to 'value' subkey2: "subvalue2" ] ] {/assocarray}
creates the following smarty assignments: $test [= "test"] $test2 [= 10] $test3 [= "this is a test"] $test4 [= array("test1", "test2", "test3")] $test5 [= array('key1'=>PATH_RELATIVE, 'key2'=>"value2")] $test6 [= array('key1'=>"value1", 'key2'=>array('subkey1'=>"value", 'subkey2'=>"subvalue2"))]