[Solar-talk] Solar meets PHPTAL!

Rodrigo Moraes rodrigo.moraes at gmail.com
Sat Oct 27 14:57:13 CDT 2007


Hello!
For a while I wanted to offer editable templates to users, and finally
I integrated a template engine to Solar. The chosen one was PHPTAL
[1]. The first working version is now in Tipos' repo, and is called
Tipos_Tal:

    http://tipos.googlecode.com/svn/trunk/Tipos/

It is basically a version of PHPTAL that works pretty much like
Solar_View and is easy to integrate in a Solar app - to start using
TAL templates in an app, you only need this:

    protected $_view_class = 'Tipos_Tal';

    // don't call Solar_Controller_Page::_preRender() because of the
GetText helper call
    protected function _preRender() {}

The initial goals were achieved and now it uses Solar_Path_Stack to
find templates (thus this is why I needed findAbsolute() :); also
several code refactorings are in course to use Solar utilities
(locale, exceptions) and to apply Solar standards to the library.

I'm going to use it only in some special cases and most of my apps
will continue to use Solar_View. But when I need templates that are
editable by users, Tal will be the choice. :)

-- rodrigo

[1] http://phptal.motion-twin.com/


More information about the Solar-talk mailing list