1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
4 -------------------------------------------------------------------------------
5 This file is part of mlib.
7 mlib is free software; you can redistribute it and/or modify it under
8 the terms of the GNU Lesser General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your option)
12 mlib is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17 You should have received a copy of the GNU Lesser General Public License; if
18 not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 Boston, MA 02111-1307 USA
20 -------------------------------------------------------------------------------
21 Created: jue jul 29 09:42:56 ART 2004
22 Authors: Martín Marrese <m_marrese@argentina.com>
23 Leandro Lucarella <luca@llucax.hn.org>
24 -------------------------------------------------------------------------------
26 -----------------------------------------------------------------------------*/
29 * Templates interface for mlib.
30 * This interface define the basic behavoir of all the template implementations
31 * in mlib. It has 4 method which are the only ones you should use when drawing
34 * @todo Add a global example using all the methods.
35 * @author Leandro Lucarella <luca@llucax.hn.org>
36 * @author Martín Marrese <m_marrese@argentina.com>
39 class /* interface */ MLIB_Tpl {
42 * Returns a parsed template.
43 * This function parses a template $name in the $group (or the current group
44 * if it's null), replacing the variables specified by $vars. $vars can be a
45 * string (in which case it's replaced by the value $val) or an asociative
46 * array, where the keys are the variables to replace and the values are the
47 * text to put in the place of the variable.
49 * @param string $name Name of template to parse.
50 * @param mixed $vars Variables to replace in the template.
51 * @param string $val If $vars is a string, the value to replace
54 * @return The parsed template $name (in $group) with its $vars replaced.
55 * @todo Add an example.
57 function parse($name, $vars = '', $val = '', $group = null)
59 trigger_error('Not implemented!', E_USER_ERROR);
63 * Sets the group to use and add it to the groups stack.
65 * @param group Group to use (and add to the groups stack).
66 * @todo Add an example.
68 function pushGroup($group = '')
70 trigger_error('Not implemented!', E_USER_ERROR);
74 * Removes the current group from the groups stack and returns it.
76 * @return Last used group.
77 * @todo Add an example.
80 trigger_error('Not implemented!', E_USER_ERROR);
84 * Returns the current group from the groups stack.
86 * @return Current group.
87 * @todo Add an example.
91 return end($this->group);
95 * Tells if a template exists.
96 * True if the template $name exists in $group (or the current group if
99 * @param name Name of the template.
100 * @param group Template's group. If it's null it uses the current group.
102 * @return true if template $name exists in $group, false if not.
103 * @todo Add an example.
105 function exists($name, $group = null)
107 trigger_error('Not implemented!', E_USER_ERROR);