PHP Classes

File: ref.template.html

Recommend this page to a friend!
  Classes of Julio César Carrascal Urquijo   Class Template   ref.template.html   Download  
File: ref.template.html
Role: Documentation
Content type: text/plain
Description: referencia de funciones
Class: Class Template
Handling templates compatible with PHPlib
Author: By
Last change:
Date: 23 years ago
Size: 6,216 bytes
 

Contents

Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//ES" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xml:lang="es" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Nimutt -&gt; PHP -&gt; Ref.Template</title> <style><!-- body { background-color: #999999; color: #000000; font: 8pt Verdana; } p, td, li { color: #000000; font-family: Verdana; font-size: 9pt; } h1, h2, h3, h4, h5, h6 { color: #6666cc; font-family: Verdana; } a { color: #009900; } a:active { color: #ffcc00; } a:hover { color: #00cc00; } a:visited { color: #990000; } small { font-size: 80%; } big { font-size: 120%; } input, textarea, select { font-family: Verdana; font-size: 9pt; } code, tt, xmp { color: #000099; font-family: Courier New, Courier, monospace; font-size: 9pt; } pre { background-color: #eeeeee; color: #000099; font-family: Courier New, Courier, monospace; font-size: 9pt; margin: 10pt; } blockquote { background-color: #eeeeee; color: #000099; margin: 10pt; } hr { width: 75%; } //--></style> </head> <body bgcolor="#999999"> <table bgcolor="#000000" border="0" cellpadding="2" cellspacing="4"> <tr valing="middle"> <td bgcolor="#000000" style="color: #ffffff; font: bold 20pt">Nimutt -&gt; PHP -&gt; Ref.Template</td> </tr> <tr valign="top"> <td bgcolor="#ffffff"> <h1>class Template.</h1> <p>Template es una clase para manejar plantillas compatible con PHPLib, pero mucho más sencilla y rápida. Si lo que está buscando es un tutorial lea <a href="class.template.html">class.template.html</a> para una introducción más amigable.</p> <h2>Propiedades.</h2> <h3>var $Root;</h3> <p>Almacena el directorio donde se van a buscar las plantillas.</p> <h3>var $Blocks;</h3> <p>Vector que almacena los bloques sin procesar.</p> <h3>var $Vars;</h3> <p>Vector que almacena las variables.</p> <h3>var $Undefined;</h3> <p>Especifica que se debe hacer con las variables no definidas</p> <h3>var $HaltOnError;</h3> <p>Especifica si se debe finalizar el script cuando se encuentre un error</p> <h2>Métodos.</h2> <h3>Template([string $root], [string $unknowns]);</h3> <p>Constructor. $root es el directorio donde se buscaran las plantillas(el directorio actual por defecto) y $unknowns especifica qué se debe hacer con las variables no definidas.</p> <h3>void set_file(mixed $name, [string $filename]);</h3> <p>Lee el fichero $filename y lo almacena en el bloque $name. Si $name es un vector se lee cada uno de los ficheros especificados de la forma array("name"=>"filename", ...);.</p> <h3>void set_block(mixed $parent, $handle, [string $name]);</h3> <p>Esta función no hace nada. Solo está disponible por compatibilidad con PHPLib. Con Template no es necesaria ya que los bloques se extraen automáticamente y se almacenan en $this->Blocks. Cuando un bloque es procesado, el resultado se almacena en $this->Vars, de forma que pueda ser incluido en otro bloque como si fuera una variable normal.</p> <h3>void set_var(mixed $var, [string $value]);</h3> <p>Registra el valor $value como $var. Si $var es un vector de la forma array("var"=>"value); entonces todo el vector es registrado.</p> <h3>string parse(string $target, [string $block], [bool $append]);</h3> <p>Procesa el bloque especificado por $block y almacena el resultado en $target. Si $block no se ha especificado se asume igual a $target. $append especifica si se debe añadir o sobreescribir la variable $target(sobreescribir por defecto).</p> <h3>int pparse(string $target, [string $block], [bool $append]);</h3> <p>Procesa e imprime el bloque especificado. Vea "parse" para una descripción de los argumentos.</p> <h3>int p(string $block);</h3> <p>Imprime el bloque especificado por $block.</p> <h3>string get_var(string $varname);</h3> <p>Regresa el contenido de la variable $varname.</p> <h3>void set_root(string $root);</h3> <p>Selecciona a $root como el directorio donde se buscarán las plantillas.</p> <h3>void set_unknowns(string $unknowns);</h3> <p>Especifica qué se debe hacer con las variables no definidas. Puede ser uno de "remove"(Eliminar), "comment"("Comentar") o "keep"(Eliminar).</p> <h3>void scan_globals(void);</h3> <p>Procesa los contenidos de la variable $GLOBALS y los hace disponibles a la plantilla. Si, dentro de la plantilla, quiere acceder al contenido de las variables globales(Como $PHP_SELF, por ejemplo) añádale G_ al nombre de la variable(por ejemplo: {G_PHP_SELF}).</p> <hr /> <pre> class Template - Clase para procesar plantillas en PHP. Copyright (C) 2000 Julio C&eacute;sar Carrascal Urquijo. &lt;adnoctum@eudoramail.com&gt; This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. </pre> </td> </tr> </table> <p align="center"><a href="http://www.w3c.org/TR/xhtml1/"><img border="0" height="31" src="xhtml.png" width="88" /></a> <a href="http://www.w3c.org/TR/css2/"><img border="0" height="31" src="mwcss.png" width="88" /></a> <a href="http://www.burnallgifs.org/"><img s" border="0" height="31" src="burnallgifs.png" width="88" /></a> <a href="http://www.debian.org/"><img border="0" height="31" src="debian.png" width="90" /></a><br /> <small>La última versión de éste documento la puedes encontrar en http://nimutt.hypermart.net/php/class.template.html</small></p> </body> </html>