phpSTE: News

phpSTE: Novedades

Jul 17 2009

Now that I got Internet working again, I'm continuing with my projects, and I have continued improving phpSTE. I have changed a lot of things since its inception, and probably I will change much more until it is polished enough, At this point it fits in 550 LoC and it is pretty functional. In addition to support inheritance, I have added the following tags: ```php {extends name=""} - extends a template. {include name=""} - includes a template. {block name=""}{/block} - defines and prints/modifies a block. {addblock name=""}{/addblock} - modifies a block adding its content to the end. {blockdef name=""}{/blockdef} - defines a block without using it. {putblock name=""} - prints an existant block. {t}{/t} - calls the gettext function {if cond=""}{/if} {elseif cond=""}{else} {for var="" from="" to="" step=""}{/for} {foreach list="" var=""}{/foreach} ``` I have done some optimizations so the tags can know if the contents is a literal, so `{t}Text{/t}` will be converted, while `{t}{if cond=1}Text{/if}{/t}` would be kept as `Text`.
Ahora que vuelvo a tener Internet en plan bien, y ya vuelvo a estar con mis proyectos, he seguido mejorando phpSTE. He cambiado bastantes cosas desde que lo empecé, y cambiaré bastantes más posiblemente hasta que esté pulido del todo. Por ahora ocupa unas 550 líneas y ya es bastante funcional. Además de soportar herencia, he añadido los siguientes tags: ```php {extends name=""} - extiende un template. {include name=""} - incluye un template. {block name=""}{/block} - define e imprime/modifica un bloque. {addblock name=""}{/addblock} - modifica un bloque añadiendo el contenido al final. {blockdef name=""}{/blockdef} - define un bloque sin utilizarlo. {putblock name=""} - imprime un bloque existente. {t}{/t} - llama a la función de gettext {if cond=""}{/if} {elseif cond=""}{else} {for var="" from="" to="" step=""}{/for} {foreach list="" var=""}{/foreach} ``` He hecho optimizaciones para que los tags puedan saber si el contenido es un literal, de forma que `{t}Texto{/t}` se convertiría a mientras que `{t}{if cond=1}Texto{/if}{/t}` se convertiría a `Texto`