Ante Web Template Engine

Ante is a new template engine that enforces the view to be seperate in a Model-View-Controller way. It helps considerable in keeping HTML out of your Model and Controller. Model and Controller seperation, however, is not part of Ante's concern.

I've updated the source again to take into consideration a few things.

  1. I've tested it on another box and made it more portable across PHP versions
  2. I've introduced the aa_ notation. See the userguide and cookbook for details.

So far, there's not much on this site yet. Use the Documentation links on the right to find out how to use Ante.

There's a sample (tiny) application. It may help to show how to use Ante for the impatient or someone who can figure things out easily on their own. The User Guide and Programming Guide with the Programmer's Cookbook explain things much better.

To run it, create an html file with aw_ classes in it. Place the html in a directory. Place a php file that includes Ante.inc into it. In the same directory as the php file create a directory named antecache which the webserver has complete access to (read, write, execute on unix). In your php file include Ante.inc. Create a Datasource (see m.php for an example of how to do that, or read the Programmer's guide to understand the whys) and then pass the datasource to Ante::render($htmlfilename, $datasource);.

In 2005-2007, I was working for a company that did website work. A lot of our (the programmer's) pain at the company was collecting information out of the database for display to the web and putting new information into it.

In early 2007, I hit upon an idea for a cleaner template system that would make it easy to build dynamic web pages without having to learn a template language. That's overstating what is done with Ante, but that was the aim. In the back of my mind though, was how I could create an easier way to retrieve information from the database to pass to the template engine and then pass input information back into the db without having the programmer much involved in the process.

In an effor to create such a system, I also created Rior.

Changes

2007 Dec 14. I've continued with refactoring. I've increased the number of files, but made each class simpler (except AwStack, that's next). I've changed the interface somewhat, but that shouldn't affect the cookbook. And it will only affect the advanced part of the programmer's guide (which I notice was just a bunch of handwaving any way). If you're affected by the change just add a method to your AwObject called getType() that returns $this. If you're still having trouble, email me and I'll do what I can.

There's also a few bug fixes and error handling additions which hopefully will make it easier to get going.

My next bit of project seems to be to update AwStack. I've realised that it seems to be doing things that would be better to be done at 'compile time'. Look for a new version in the new year. Happy new year everyone!

2008 May 5. I've updated the source again to take into consideration a few things.

  1. I've tested it on another box and made it more portable across PHP versions
  2. I've introduced the aa_ notation. See the userguide and cookbook for details.

Unfortunately, the changes mentioned above about moving things to compile time are still to come.