Saturday, 17 August 2013

PHP MVC- Integrating Controllers and Views

PHP MVC- Integrating Controllers and Views

I am trying to build a web application using MVC design pattern in PHP.
But before starting I tried to implement a small mvc application and
cannot figure out how to deal with following scenario.
I created Index_Controller ,Index_Model and index directory which acts as
controller, model and view for Index page respectively. I tried to
integrate FileUploader in that Index page and created
FileUpload_Controller , FileUpload_Model (because I will store Image
Captions and other data related to file(s) in database) and fileupload
view. Now I am able to view Index Page from this URI :
http://localhost/mvc/index/ and the FileUpload Plugin using this URI :
http://localhost/mvc/fileupload/ but how could I integrate the
FileUploader Plugin in Index and some other (if required) pages. Accessing
http://localhost/mvc/fileupload/ only is meaning less and It should be
integrated in some other views.
I am confused on what should be created using Model , View And Controllers
. I think the way I have created FileUpload Plugin is wrong. I used MVC
for FileUpload because I have to deal with Database also. I think I am not
clear on for what type of entity should I create Models , Views and
Controllers.
Any guideline and help will be much more appreciated. Thank you.

No comments:

Post a Comment