-
preface
... have to learn a syntax anyways, why not PHP?" Of course web designers can learn...
...d designers quick and easy to maintain syntax easy to understand, no PHP knowled...
...s that presentation should be void of all programming code, and instead use simp...
... for application code, but quickly degenerates when mixed with HTML. Smarty's si...
... design was largely driven by these goals: clean separation of presentation from...
-
language.function.section
...ke {foreach} which is used to loop over a single associative array . Every {sect...
.... Every {section} tag must be paired with a closing {/section} tag. Note The {fo...
... looping over sequentially indexed arrays of data , unlike {foreach} which is us...
...l determine the loop count by the array size, or you can pass an integer to spec...
...lse} Results of a database search (eg ADODB or PEAR) are assigned to Smarty ?php...
-
language.syntax.variables
...ith presentation to PHP by way of plugins or modifiers. Request variables such a...
...variables are an exception to the $dollar syntax and are instead referenced with...
... sign. They can contain numbers, letters and underscores, much like a PHP variab...
... the 5th element of a zero-indexed array {$foo.bar} -- display the "bar" key val...
.... You can reference arrays by index numerically or non-numerically. Also referen...
-
variable.plugins.dir
...ugins_dir This is the directory or directories where Smarty will look for the pl...
...given . Technical Note For best performance, do not setup your $plugins_dir to h...
...f directories, Smarty will search for your plugin in each plugin directory in th...
-
api.append.by.ref
...ect properties behave this way by default. Technical Note The merge parameter re...
... merge ); This is used to append() values to the templates by reference. Tec...
...a PHP array index value to be affected by its reassignment from a template. Assi...
... you merge two numerically indexed arrays, they may overwrite each other or resu...
... appendByRef() appendByRef() appendbyref, appendByRef() Prev  Chapter 14....
-
language.modifier.regex.replace
...fier, it is usually better to apply regular expressions in PHP, either via custo...
...ce modifier, it is usually better to apply regular expressions in PHP, either vi...
...place A regular expression search and replace on a variable. Use the preg_replac...
-
language.modifier.replace
...riable. This is equivalent to the PHP's str_replace() function. Parameter Positi...
...s is the string of text to be replaced. 2 string Yes n/a This is the string of t...
... Next replace A simple search and replace on a variable. This is equivalent ...
-
language.function.foreach
...= $myValue} , the key is always available as $myValue@key within the foreach loo...
...ibutes. This syntax is new to Smarty 3, however the Smarty 2.x syntax {foreach f...
...orted. {foreach} loops can be nested. The array variable, usually an array of va...
...rrent key of the loop item by {$item@key} (see examples below). Note The $var@pr...
...O) example of looping over search results. This example is looping over a PHP it...
-
language.modifier.upper
... Next upper This is used to uppercase a variable. This is equivalent to the PH...
..., "If Strike isn't Settled Quickly it may Last a While."); ? Where template is: ...
-
api.append
...— append an element to an assigned array Description void append ( mi...
...r of TRUE , the value will be merged with the current array instead of appended....
... you merge two numerically indexed arrays, they may overwrite each other or resu...
...raska')); ? See also appendByRef() , assign() and getTemplateVars() Prev  Up...
-
language.function.insert
... the second argument. This way you can reference and modify information in the S...
...he output will be assigned to script string No n/a The name of the php script th...
...rom Smarty, and should not be used. Put your PHP logic in PHP scripts or plugin ...
...ners, polls, live weather, search results, user feedback areas, etc. See also {i...