Templating with Smarty for Ajax Enabled Applications
And I mean both on the client side and the server side. Am I going crazy?
Just wait for node.js to be ready for prime time and let the YUI Library be finished with the application framework, then we start talking.
However, while we wait for the day of the grand merging of technologies, we still have to do some work and keep the code nicely organized. Smarty helps me to do that. I use Smarty templates to separate code from presentation and (among other things) Smarty plugins to organize my code.
In the meanwhile, get YUI and AJAX to work nicely with Smarty and PHP
Manageable to me means among other things that:
- I can include my php files from wherever I want, especially from outside my server root
- I can have a one-to-one relationship between the page I’m showing to the user and the code that supports it
These are the things I felt YUI was making difficult to me.
If you use YUI and PHP, and you too think that life is too nice to use time reinventing the wheel each time a JS code need to talk to your server, you might want to give it a try. It’s free, open source and BSD licensed.
Click to see usage instructions and working examples