model view controller - Folder structure of a PHP MVC framework... am I doing this right? -


I am currently working on my PHP framework, and I need some help if I am going right Direction or not ...

The structure is for my own use and generally enhances my PHP skills further. I have to face many problems, by controlling them, I have learned a great deal, and being able to produce something from nothing, I could not see the answer like "Use Z"! ;)

I have read a bunch of articles on both the stack overflow and a group of other sites, but I can not find the correct answer, so hopefully someone can give me some useful advice!

I have tried some different solutions, but I have confused myself so far and I am not sure which direction to go now! .htaccess - - index.php can not get enough of all this ...

'theoretical' structure structure

  around my head - Private / - Application / - bootstrap.php - Module / - Default / - Controllers / - pages.php - index.php - Models / - Ideas / - Admin / - Controllers / - Models / - Ideas / - config / - config . Php - autoloader.php - lib / - Some_Library - Class1 - class1.php - Class2 - class2.php - public / - css - image - script  

description

  • index.php is the main file, where each request is sent with .htaccess .
  • <
  • Public / has all the public files.
  • Apps have all app-specific codes.
  • lib / can have Zend or any other library (I am also working on my own), to call with Autoloaders
  • < Em> bootstrap.php is an app-specific code ... Do I need it? What is the main 'index.php' enough? .
  • In the module / each module will be included ... Do I need the module at all? .
  • Default / is a default module that will include MVC for most requests (when 'Admin' is not the first part of the URL).
  • Administrator is the module in which the admin section is MVC.
  • Anyway, for my question ...

    I thought it would be better to separate the admin section from the rest of the website But that's where I'm stuck. I have built up the structure to work with it, but I'm not sure that this is the most effective way.

    If a request site.com/videos/view/1/

    module : Default Controller : Video Action : Parameter : array ('1')

    and request site.com/admin/pages/view

    Module : Administrators Controllers : Pages Action : Ultimate : Array ('1')

    Is this the right way to go about this? Or am I confused and not doing it?

    Do I have a completely different application framework for my admin section ...? Do I need to separate the MVC of the Admin section from the rest of it?

    Sorry for the big question, just wanted to give you as much information as possible! Feel free to answer whatever part you can do = P

For administrator routing One solution is what CakePHP does, you first define a configuration for the administrator strings and then your controller use functions with a specific naming conversion

  // configuration ==== ============= =========== Configure :: Write ("admin_routing", true); Configure: Write ("admin_prefix", "admin"); // Controller ============================ / Mycontroller function will be normalized by admin_index () {// to / admin / mycontroller}}  

You can do this generalization by using a routing system just to see how Your favorite framework is such that p>

on another note

  1. module folder being unecesary
  2. I antpaw you to share them with one Global Perspective and Models All users agree with the adder should be
  3. I can not find why the autoloader is inside the config directory and not as part of lib directory, you can also move bootstrap.php to the instructions directory.

Hope this helps


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -