News 
15 January 2011

RainTPL 2.4.9 beta

Mantain Rain easy and fast, but more complete is our challenge! So here we are with the new version (in beta), that implements new features:

  • static cache, the output of the template can be cached as static page. The static cache improve drastically the load speed of template, but it ignore totally any changes of contents or templates for all the valid time of the cache. It's advised to use this feature for contents that rarely changes.

  • {empty} tag added to {loop}{empty}{/loop}. If the array into the loop is empty and there is this tag, it will draw the content between {empty} and {/loop}: eg.


    {loop="user_list"}
       {$value.name}<br/>
    {empty}
       List is empty
    {/loop}
  • short tag, you can now use {loop="..."} instead of {loop name="..."}, same with {if} and {elseif} tags. The old form is still supported, so you'll don't need to change your old templates.

  • $ into loop, it happen few times to get feedback about an error in {loop} when added the $ at variable. The correct syntax of loop is the following {loop="list_name"}, now {loop="$list_name"} is ok too.

  • Objects, you can add objects to the template, so the variable scoping changed:
    - use the dot operator for accessing arrays elements
    {$value.name}


    use the arrow operator for accessing object properties and methods!
    {$obj->method()}
    {$obj->variable}

 

Rain 2.4.9 beta is available for download.
Documentation was changed for the new version, we'll wait for few feedback to publish the official version.

Rain Tpl

Easy PHP template engine which compiles templates.

Join the Google Group
rain google group