Skip to content

02.09 Formulas

rafageist edited this page Nov 16, 2026 · 1 revision

2.9 Fórmulas

Las fórmulas evalúan expresiones PHP dentro de las plantillas. Solo se permite un conjunto restringido de funciones de PHP. Consulta 05.01 Apéndice A - Funciones PHP permitidas.

Sintaxis

(# formula #)
(# formula : number format #)

El formato de números sigue las reglas de 02.08 Formatos de datos.

Ejemplo

index.tpl

{= number: 200.000 =}
{= price: 20.000 =}
{= tax: 0.345 =}

5 + {$number} = (# 5 + {$number} #)

Price with tax: $ {$price} + $ {#tax:2.#} = $ (# {$price} + {$tax} :2. #)

Salida

5 + 200 = 205

Price with tax: $20 + $0.35 = $20.35

Div

Enlaces

Clone this wiki locally