My favorites | Sign in
Project Logo
                
Search
for
Updated May 06, 2008 by nsbucky
Labels: Featured
MagicStuff  
explaining some fun stuff that comes with it

Introduction

The magic is very limited. Magic, or abstractions rather, tend to make it difficult to find out what is happening in your application. But in an effort to limit the amount of times you might have to repeat yourself, some conventions are in place that will make your life easier.

Directory Structure

Take a look at the init.php file in the root directory. Notice the MODULES_DIR constant. You can set this to be anywhere you'd like. The autoload function will be called when Web::run() tries to include a class, and will look in that folder for any possible class. If it finds it, it will also create a constant called TEMPLATES_DIR, which is relative to the modules directory.

The modules directory should be set up like this:

/modules

/class_name
class_name.php
/templates

When Web::run() is called, it will see if TEMPLATES_DIR is defined, and then add it to the template include paths of Savant3.

You of course do not have to use this set up, and can just define the classes on the index page if you want. But if you start to have alot of classes, it makes sense to separate them into directories with their own templates.

Included Libraries

The main download ships with:

By no means do you have to use these (although templating via Savant3 is implied), but some included functionality like recordset paging etc will be made easier.


Comment by bdarcus, May 27, 2008

I'm getting template not found errors, but am pretty sure I've followed the above directions correctly. Any suggestions?


Sign in to add a comment
Hosted by Google Code