Adding And Using Classes

To add a class simply create the class within the c1,c2 orc3 folders and name it.
Next place the path to the class file just above the View(page-part) in which it is needed.
Next call the class within the View part using Php short tags.
There is a Sample class named questions installed to refer to.
THIS DOES NOT REQUIRE ANY PHP INCLUDES ABOVE ANY FILE OR VIEW FOR THE CLASS.
IT IS DONE AUTOMATICALLY !

Using Functions

Same as above and this too requires no Php includes on any file or view.
Functions are a bit different from classes in that they are not wrapped, so defined variables within them may pose a problem with naming on the same page.

A class will wrap the variables and their scope only to each class and when calling the functions from a class will allow variable names to be shared unless passed outside of the functions.

Functions work just as good as classes to do specific queries and fetching POST and GET variable values.
When these are called on the page they will do their specific task and return or echo the needed results.

Adding New Modules

To add a new Module simply name a set of all folders in the next order m4,c4,v4,l4,p4 etc. Then copy and paste a class router into the m4 folder from m2 or m3 and start changing paths. This will come in very handy for creating group's friends, albums for users etc. So you may end up with 4,5,6,7,8 and so on. Now everything and every file is easily managed from the Alhanumeric naming and the class router list of pages. Have fun ! I have developed several facebook type wall posting systems with this framework already. One of which i will have up soon and will post a link here.

Last edited Apr 22, 2013 at 6:58 AM by about2mount, version 1

Comments

No comments yet.