-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
88 lines (75 loc) · 3.89 KB
/
README
File metadata and controls
88 lines (75 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
This project is based off of the Certis PHP Framework. Certis is a lazy
coder's contribution to the PHP community of lazy coders. Actually,
it's an MVC framework that is highly focused around reusable code and
ease of use. It's also modular so that you can add and remove
functionality to your project very easily and intuitively
I can't take all the credit for this, it's based off of and extrapolated
from an idea that my friend and fellow coder Edwin (the original Tux Monkey)
came up with.
Included in the Certis Framework Package, is an example module called
'hosts.' To see how this example module works, you will need the
'hosts.sql' file from the 'data' directory loaded into the database
that Certis is set up to use.
Also included is a base system wide controller.php file and some simple
base system wide templates.
The structure of the Certis framework should be pretty self explanitory,
but here's a brief overview of each subdir from the top level:
/
/bin - console level system wide programs.
/html - the main html directory, point your aliases here.
/system - the main guts of the frame work
/config - where the config files go
/includes - system wide includes, no module stuff here.
init.php - the main initializer for Certis, called by index.php
in the html directory.
/classes - where the system wide classes go
API.class.php - the main class for utility functions
used in the framework
Controller.class.php - the main class that takes care of
common controller functions
DB.class.php - The main database interface class.
DefaultController.class.php - A default implementation of
the controller class, see
this file for more info
Model.class.php - the main class for db modeling functions
this class inherits the DB class for ease
of use.
View.class.php - The main class for view abstraction.
/modules - where all the modules that do stuff go.
/<module_name> - the name of module all lower case, no spaces
/templates - the module level html templates
controller.php - the controller for this module
<Module_name>.model.php - the db model for this module
module.js - (optional) contains module specific js code.
module.css - (optional) contains module specific CSS code.
init.php - (optional) module specific initialization code.
/templates - system level templates
controller.php - the MainController instance. Used when you to go
http://myhost.com/
Here is a general overview of how things progress:
- request comes into index.php
- index.php loads the config, and runs init.php from the includes/ directory.
- init.php loads the system classes, all module model classes, then runs all
module init.php files.
- control returns to index.php which runs parseUri() to populate the necessary
get variables depending on the 'pretty_urls' setting
- index.php loads the requested module's controller.php file and instantiates
the module's controller which should have a name of ModuleController where
Module is the name of the module requested. If no module is requested,
the system wide MainController is instantiated after loading the system
wide controller.php file
- check to see if this is an ajax call, and loads the header if not
- set up the action for this request, default to 'index'
- add the action's template ot the stack
- call the action method off of the controller class
- add on the footer if it's not ajax
- call displayPage() on the controller which will call down to the View
object and send the data for the page along.
Using Certis is pretty easy. As a matter of fact, you might think you're
doing something wrong, that's how easy it is. Have a look at the hosts
module if you don't believe me. A small amount of code to do a decent
amount of stuff. And it's all reusable.
If you have comments or suggestions, feel fee to email me at
<certis@tulg.org>
--
The Uber