[AJAX template engine] Fluctuate
Hi everyone !
I’m glad to present a new open source project I started some days ago. This project is called “Fluctuate” since it’s an AJAX template engine with some CSS class definition helpers.
The documentation is not made yet but there’s a google code page to browse the source code. Once again, IT’S OPEN SOURCE. What I mean is everyone is encouraged to propose/add features, notice bugs and develop some code about it. More about that here :
http://code.google.com/p/fluctuate/
So in two words (ok a bit more than two), what is Fluctuate ? And what does it tend to be ?
There are several frameworks and/or templates engine specifically made for web. But i’m sure you noticed (as a developer) there is AJAX requests everywhere on the web. So, why couldn’t we merge both concepts ?
Fluctuate is both a PHP controller helper and an HTML view template engine. Fluctuate also automatically generates useful CSS classes on returned content (odd, even, first, last).
- Wanna transform your standard forms in AJAX forms ? With Fluctuate, you just have to add an ajax attribute to your submit element (any element) to make the form totally AJAX handled.
- Need to refresh some content each x seconds ? You just have to add a “refresh=x” parameter in the fluctuate attribute of your HTML container (more about that on the google code’s page and in the html example posted just below.
Okay, blablabla, you want to see an example don’t you ? Look at the html source file here (Sorry, styling html code in wordpress is a pain in the ***) :
http://code.google.com/p/fluctuate/source/browse/trunk/fluctuate.html
- Any value attribute starting with the “@” character will look for the data to write in the element or to set if the element is an input.
- The “@parity” class will automagically create odd/even classes on returned data.
- The “@index” class will create indexed classes and first/last classes on returned data.
- The “post-data” attribute will add the specified data to any post ajax request sent with any child form.
Well, since it’s undocumented, it may be hard and/or unpleasing to read. But this is a start. Once again, anyone is encouraged to browse source and code stuff. The comments are open if you have any question about this !