root/branches/3.1/docs/news.txt

Revision 322, 3.7 kB (checked in by schst, 4 years ago)

updated news, added todos

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 New features:
2 -------------
3 $Id$
4
5 New features in v3.1.0:
6 - allowed more than one namespace
7 - added defaultFunction option, to define a function that is called for unknown functions
8 - added new built-in condition __single
9 - allow quoting variables using \{FOO\}
10 - implemented autoload in Call function
11
12
13 New features in v3.0.0:
14
15 1. Features
16 -----------
17 The following features are new to patTemplate since version 3.0.0
18
19 1.1 Improved reader
20 The reader now accepts tags and data or even several tags in one line.
21
22 1.2 New architecture
23 patTemplate is now split into several different modules. This allows
24 you to load components at runtime and keep the main codebase small.
25 The available modules are:
26
27 1.2.1 Reader
28 Splitting the template reader from the main class has several advantages:
29 * Read templeates not only from file but from any datasource. Readers for
30   files and strings have been implemented already.
31 * Read different template types. Currently patTemplate shippes with a reader
32   that is able to read templates that have been created for PEAR's
33   HTML_Template_IT. As PHPLib uses the same template format, it is also possible
34   to work with templates created for the PHPLib templating system.
35
36 1.2.2 Dump
37 As the dump() functionality is split from the main engine, it increases performance.
38
39 1.2.3 TemplateCache
40 1.2.4 Input Filter
41 1.2.5 Output Filter
42 1.2.6 Custom Functions
43 1.2.7 Variable Modifiers
44
45 1.3 New Tags
46
47 1.3.1 <patTemplate:var/>
48 1.3.2 <patTemplate:comment/>
49
50 1.4 Modulo Templates
51 Modulo templates are similar to OddEven templates, but you may define how many
52 different sub-templates you need.
53
54 1.5 Flexible Namespace
55 It's possible to change the namespace of patTemplate, simply
56 use the new method setNamespace()
57
58 1.6 Several new features for variables
59
60 1.6.1 <patTemplate:var/>
61 patTemplate 3 introduces the <patTemplate:var/> tag that introduces new
62 features:
63  * default value for a variable
64  * copy the value of a variable
65  * apply a modifier to a variable (PHP function or custom object)
66  * Do not display, but calculate (could be used to count the chars of
67    any variable and store the result in another variable that is
68    used as a condition variable)
69
70 1.6.2 Multi-dimensional arrays
71 You may now pass a multi-dimensional array to patTemplate and the engine
72 will add the variables in the array to the child-templates.
73    
74 1.7 Support for user-defined tags
75 You may define any tag and register a PHP class that will create the
76 HTML code that will be inserted.
77
78 1.8 Dynamic includes
79 It is now possible to change the source of an external file at runtime.
80 You'll have to add autoload="off" to the template and then use
81 $tmpl->setAttribute( 'tmpl', 'src', 'myFile.tmpl' ) to change the file that
82 should be included.
83
84 1.9 Misc other features
85
86 * new built-in conditions __odd, __even, __first, __last,
87   __default and __empty
88 * new attribute 'addSystemVars'
89 * it's possible to add variables before reading a template
90   prepareTemplate( string tmpl ) must be called for that.
91 * external templates will be loaded when needed
92
93
94 2. PHP-API
95 ----------
96
97 2.1 New methods
98 ---------------
99
100 2.1.1 patTemplate::addObject( string template, object obj [, string prefix] )
101 This allows you to add any PHP object to a template. In the template, all
102 properties of the object are available as template variables.
103 Optionally it is possible to specify a prefix.
104
105 2.1.2 patTemplate::parseIntoVar()
106
107 2.1.3 patTemplate::setNamespace( string namespace )
108 Allows you to change the namespace for the patTemplate tags.
109
110 2.1.4 patTemplate::readTemplatesFromInput()
111
112 2.1.5 patTemplate::setRoot( string root )
113
114
115 2.2 Deprecated methods
116 ----------------------
117
118 You should not use the following methods.
119
120 2.2.1 patTemplate::setBasedir()
121 Please use setRoot() instead.
122
123 2.2.2 patTemplate::readTemplatesFromFile()
124 Please use readTemplatesFromInput() instead
Note: See TracBrowser for help on using the browser.