Smarty 2.6.14 Docs Es

  • View
    105

  • Download
    0

Embed Size (px)

Text of Smarty 2.6.14 Docs Es

Smarty Manual

porMonte Ohrt y Andrei Zmievski

Smarty Manual

publicado 07-09-2007 Copyright 2001-2005 New Digital Group, Inc.

Tabla de contenidosPrlogo .............................................................................................................................................. vi I. Iniciando .......................................................................................................................................... 1 1. Que es Smarty? ......................................................................................................................... 2 2. Instalacin ................................................................................................................................ 4 Requerimentos ..................................................................................................................... 4 Instalacin Bsica ................................................................................................................. 4 Expandiendo la configuracin ................................................................................................. 7 II. Smarty For Template Designers ........................................................................................................... 9 3. Basic Syntax ........................................................................................................................... 11 Comentarios ....................................................................................................................... 11 Variables ........................................................................................................................... 11 Funciones .......................................................................................................................... 12 Atributos ........................................................................................................................... 12 Colocando variables entre comillas dobles ............................................................................... 13 Matemticas ....................................................................................................................... 13 Escaping Smarty Parsing ...................................................................................................... 14 4. Variables ................................................................................................................................ 15 Variables definidas desde PHP .............................................................................................. 15 Variables cargadas desde archivos de configuracin ................................................................... 17 La variable reservada {$smarty} ............................................................................................ 18 5. Modificadores de variables ........................................................................................................ 21 capitalize ........................................................................................................................... 22 cat .................................................................................................................................... 22 count_characters ................................................................................................................. 23 count_paragraphs ................................................................................................................ 24 count_sentences .................................................................................................................. 24 count_words ...................................................................................................................... 25 date_format ........................................................................................................................ 25 default .............................................................................................................................. 27 escape ............................................................................................................................... 28 indent ............................................................................................................................... 29 lower ................................................................................................................................ 30 nl2br ................................................................................................................................. 30 regex_replace ..................................................................................................................... 31 replace .............................................................................................................................. 32 spacify .............................................................................................................................. 32 string_format ...................................................................................................................... 33 strip .................................................................................................................................. 34 strip_tags ........................................................................................................................... 34 truncate ............................................................................................................................. 35 upper ................................................................................................................................ 36 wordwrap .......................................................................................................................... 36 6. Combinando Modificadores ....................................................................................................... 38 7. Funciones Integradas ................................................................................................................ 39 capture .............................................................................................................................. 39 config_load ........................................................................................................................ 40 {foreach},{foreachelse} ....................................................................................................... 42 include .............................................................................................................................. 44 {include_php} .................................................................................................................... 45 insert ................................................................................................................................ 46 if,elseif,else ........................................................................................................................ 47 {ldelim},{rdelim} ............................................................................................................... 49 literal ................................................................................................................................ 50 iii

Smarty Manual

{php} ............................................................................................................................... 50 section,sectionelse ............................................................................................................... 51 {strip} ............................................................................................................................... 60 8. Custom Functions .................................................................................................................... 61 {assign} ............................................................................................................................ 61 {counter} .......................................................................................................................... 62 cycle ................................................................................................................................. 63 {debug} ............................................................................................................................ 64 {eval} ............................................................................................................................... 64 {fetch} .............................................................................................................................. 65 {html_checkboxes} ............................................................................................................. 66 {html_image} ..................................................................................................................... 68 {html_options} ................................................................................................................... 68 {html_radios} ..................................................................................................................... 70 {html_select_date} .............................................................................................................. 72 {html_select_time} .............................................................................................................. 75 {html_table} ...................................................................................................................... 79 math ................................................................................................................................. 81 {mailto} ..............................................................................