X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/7cf842a030ae53c788c301b5eeeeadacb46a938d..3e6adf5872b79e027c5966c92a98da157eac5f4b:/lib/MLIB/Tpl.php?ds=inline diff --git a/lib/MLIB/Tpl.php b/lib/MLIB/Tpl.php index e1f82c6..e0c3c39 100644 --- a/lib/MLIB/Tpl.php +++ b/lib/MLIB/Tpl.php @@ -18,59 +18,95 @@ You should have received a copy of the GNU Lesser General Public License; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------------- -Creado: jue jul 29 09:42:56 ART 2004 -Autor: Martín Marrese - m_marrese@argentina.com +Created: jue jul 29 09:42:56 ART 2004 +Authors: Martín Marrese + Leandro Lucarella ------------------------------------------------------------------------------- $Id$ -----------------------------------------------------------------------------*/ /** - * Clase dummy / interfaz para los templates de mlib. - * Establece los parametros para el contructor y los parametros del metodo - * parse. + * Templates interface for mlib. + * This interface define the basic behavoir of all the template implementations + * in mlib. It has 4 method which are the only ones you should use when drawing + * your components. + * + * @todo Add a global example using all the methods. + * @author Leandro Lucarella + * @author Martín Marrese + * @since 1.0 */ -class MLIB_Tpl { +class /* interface */ MLIB_Tpl { /** * Returns a parsed template. + * This function parses a template $name in the $group (or the current group + * if it's null), replacing the variables specified by $vars. $vars can be a + * string (in which case it's replaced by the value $val) or an asociative + * array, where the keys are the variables to replace and the values are the + * text to put in the place of the variable. * * @param string $name Name of template to parse. * @param mixed $vars Variables to replace in the template. * @param string $val If $vars is a string, the value to replace * for $vars. * - * @access public - * @return mixed + * @return The parsed template $name (in $group) with its $vars replaced. + * @todo Add an example. */ - function parse($name, $vars = '', $val = '') + function parse($name, $vars = '', $val = '', $group = null) { - trigger_error('Not implemented!', E_USER_WARNING); + trigger_error('Not implemented!', E_USER_ERROR); } /** - * Returns the template file name based on the blockname + * Sets the group to use and add it to the groups stack. * - * @param string $block BlockName. + * @param group Group to use (and add to the groups stack). + * @todo Add an example. + */ + function pushGroup($group = '') + { + trigger_error('Not implemented!', E_USER_ERROR); + } + + /** + * Removes the current group from the groups stack and returns it. + * + * @return Last used group. + * @todo Add an example. + */ + function popGroup() { + trigger_error('Not implemented!', E_USER_ERROR); + } + + /** + * Returns the current group from the groups stack. * - * @access public - * @return mixed + * @return Current group. + * @todo Add an example. */ - function getFileName($block) + function getGroup() { - trigger_error('Not implemented!', E_USER_WARNING); + return end($this->group); } /** - * Returns the template file content. + * Tells if a template exists. + * True if the template $name exists in $group (or the current group if + * $group is null) * - * @param string $file Filename. + * @param name Name of the template. + * @param group Template's group. If it's null it uses the current group. * - * @access public - * @return mixed + * @return true if template $name exists in $group, false if not. + * @todo Add an example. */ - function getFileContent($filename) + function exists($name, $group = null) { - trigger_error('Not implemented!', E_USER_WARNING); + trigger_error('Not implemented!', E_USER_ERROR); } + } + ?> \ No newline at end of file