-
preface
...d designers quick and easy to maintain syntax easy to understand, no PHP knowled...
...tegration Sometimes Smarty gets compared to Model-View-Controller (MVC) framewor...
...esentation. Smarty focuses your templates on presentation and less on "code". Th...
...ce Template inheritance is new to Smarty 3, and it's one of many great new featu...
...ices section of the Smarty website. How does it work? Under the hood, Smarty "co...
... design was largely driven by these goals: clean separation of presentation from...
-
language.syntax.variables
...variables are an exception to the $dollar syntax and are instead referenced with...
... find your template syntax getting too complex, it may be a good idea to move th...
... presentation. If you find your template syntax getting too complex, it may be a...
... 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...
-
api.append.by.ref
... merge ); This is used to append() values to the templates by reference. Tec...
...so append() , assign() and getTemplateVars() . Prev  Up  Next append()Â...
... you merge two numerically indexed arrays, they may overwrite each other or resu...
... appendByRef() appendByRef() appendbyref, appendByRef() Prev  Chapter 14....
-
caching
...Cacheability of Plugins Custom Cache Implementation Caching is used to speed up ...
...ignments here. $contents = get_database_contents(); $smarty- assign($contents); ...
...splaying the front page of your website that does not change its content very of...
...ith a timetable containing new information by the minute, it would not make sens...
...ing the front page of your website that does not change its content very often, ...
...ll to display() or fetch() by saving its output to a file. If a cached version o...
-
bugs
...on of Smarty, or check the website. Prev  Up  Chapter 22. Resource...
-
advanced.features.static.classes
...in PHP. Note Direct access to PHP classes is not recommended. This ties the unde...
...HP classes/objects. Use at your own discretion. See the Best Practices section o...
...ices section of the Smarty website. Example 17.10. static class access syn...
-
what.is.smarty
...cilitates a manageable way to separate application logic and content from its pr...
...y? Prev  Part I. Getting Started  Next Chapter 1. What is Sm...
...s logic in the template is your own doing. Also, if you desire no logic in your ...
... page that is displaying a newspaper article. The article $headline , $tagline ,...
...hey are passed into Smarty by the application. Then the template designer edits ...
-
api.assign
... assign variables/objects to the templates Description void assign ( mixed...
...ty- assign('contact', $db- getRow($sql)); ? These are accessed in the template w...
...ices section of the Smarty website. Example 14.6. assign() ?php // passing...
...d {section} See also assignByRef() , getTemplateVars() , clearAssign() , append(...
-
api.register.object
...ou register/assign objects to templates, be sure that all properties and methods...
...more information. See also getRegisteredObject() , and unregisterObject() . Prev...
...ices section of the Smarty website. See the objects section for more information...
-
api.append
...— append an element to an assigned array Description void append ( mi...
...pendByRef() , assign() and getTemplateVars() Prev  Up  Next addTemplateD...
... you merge two numerically indexed arrays, they may overwrite each other or resu...
...raska')); ? See also appendByRef() , assign() and getTemplateVars() Prev  Up...
-
advanced.features.objects
...jects Smarty allows access to PHP objects through the templates. Note When you a...
... same way custom functions get them. An associative array is passed as the first...
...oose will be determined by your needs, but use the first method whenever possibl...
...is my meth1'; } } $myobj = new My_Object; // registering the object (will be by ...
...ices section of the Smarty website. There are two ways to access them. One way i...
... choose will be determined by your needs, but use the first method whenever poss...
-
language.function.section
...ke {foreach} which is used to loop over a single associative array . Every {sect...
...y- assign('contacts', $db- getAll($sql)); ? The template to output the database ...
... 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...