October 16, 2006
AJAX with Smarty? It can be done!
Under normal circumstances, once you’ve passed your footer template to Smarty->display(), you’re done. There’s no going back without a refresh. Well, that was before Dmytro Shteflyuk wrote a sexy PHP library, aptly named smarty_ajax.
It does have some limitations, however; one of which is a complete lack of support for object-oriented PHP. I modified smarty_ajax’s ajax_update and ajax_call tools and (among other things) added an optional parameter, object=”". Now you can call class methods from the client with just one line of code, and display their output, all without giving up Smarty as your templating engine!
Since I haven’t yet had a chance to contact Mr. Shteflyuk about committing my patch, you can stare at, download, play with and mangle my version from here for the mean time. But if you break something, don’t expect him to know anything about it! Comment here or email me for help instead, until it is released.
peace

By email





















