Login   Register  
PHP Classes
elePHPant
Icontem

File: read-me.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Junaid Hassan  >  PHP MVC  >  read-me.txt  >  Download  
File: read-me.txt
Role: Documentation
Content type: text/plain
Description: Project description
Class: PHP MVC
MVC framework that loads XML configuration files
Author: By
Last change:
Date: 2013-04-27 07:03
Size: 1,957 bytes
 

Contents

Class file image Download
PHP MVC

Developer:

Junaid Hassan
Email: junaidhassanalvi@gmail.com
Blog: junaidhassanalvi.wordpress.com


Description:

This project is a very simple MVC controller. It is designed for those developers, who are bearing stick timeline and just need a MVC structure to start.

Rules are simple like other MVC

You have to set configuration in config.xml in includes folder

URL will be 
http://www.your-domain-name.com/controller/action/parameter1/parameter2/parameter3…..

.htaccess provides the handling of re-written URLs.

For controllers, put your controllers in the controller folder. Controller file name must be same as controller provided in URL, with php extension. Inside controller file, there must be a class, named same as controller name, prefixed with ‘”Controller” keyword. Controller class must be inherited with “Controller” class.

For action, in controller class, there must be a method, named same as action in URL, prefixed with “Action” keyword and should take same number of parameters, provided in URL.

For models, you can load models in your action method with loader object. You need to call model method of loader class and need to pass model name. Example is in home controller’s action method.
To load models, put your models in the model folder. Model file name must be same as the model name, with php extension. . Inside model file, there must be a class, named same as model  name, prefixed with ‘”Model” keyword. Model class must be inherited with “Model” class.

For views, you can load views in your action method with loader object. You need to call view method of loader class and need to pass view name. Example is in home controller’s action method.
To load views, put your views in the views folder. View file name must be same as the view  name, with php extension. 

You can create your own custom controllers, models, views, include files, helpers and uses them accordingly.