Citas Citables


domingo, 14 de marzo de 2010

Operadores Smarty


Estos son los operadores basicos del manejador de plantillas Smarty para php, y siempre me confundo, asi que, mi pasa.

Simbolo Alternativa Ejemplo Sintaxis Significado en PHP es
== eq $a eq $b igual a ==
!= ne, neq $a neq $b no igual !=
> gt $a gt $b greater than >
< lt $a lt $b menor que <
>= gte, ge $a ge $b mayor o igual que >=
<= lte, le $a le $b menor o igual que <=
=== $a === 0 identico ===
! not not $a negacion (unario) !
% mod $a mod $b resto %
is [not] div by $a is not div by 4 divisible por $a % $b == 0
is [not] even $a is not even [not] an even number (unary) $a % 2 == 0
is [not] even by $a is not even by $b grouping level [not] even ($a / $b) % 2 == 0
is [not] odd $a is not odd [not] an odd number (unary) $a % 2 != 0
is [not] odd by $a is not odd by $b [not] an odd grouping ($a / $b) % 2 != 0

Las alternativas se utilizan tal cual pero solo en las plantillas

Estos son los operadores basicos del manejador de plantillas Smarty para php, y siempre me confundo, asi que, mi pasa.

Simbolo Alternativa Ejemplo Sintaxis Significado en PHP es
== eq $a eq $b igual a ==
!= ne, neq $a neq $b no igual !=
> gt $a gt $b greater than >
< lt $a lt $b menor que <
>= gte, ge $a ge $b mayor o igual que >=
<= lte, le $a le $b menor o igual que <=
=== $a === 0 identico ===
! not not $a negacion (unario) !
% mod $a mod $b resto %
is [not] div by $a is not div by 4 divisible por $a % $b == 0
is [not] even $a is not even [not] an even number (unary) $a % 2 == 0
is [not] even by $a is not even by $b grouping level [not] even ($a / $b) % 2 == 0
is [not] odd $a is not odd [not] an odd number (unary) $a % 2 != 0
is [not] odd by $a is not odd by $b [not] an odd grouping ($a / $b) % 2 != 0

Las alternativas se utilizan tal cual pero solo en las plantillas

0 comentarios: