Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Im sure theres plenty of links been posted to get you started but some important factors in creating an MVC is:</p> <ul> <li>Static Registry Class (Store objects and fetch with a global scope)</li> <li>Router (A class that determains the controller/method and params from URI's)</li> <li>Base Controller (just a small abstract class then the users controller can extend)</li> <li>SPL Auto-loading (this will allow users to extend classes such as <code>Model_Database</code>)</li> <li>Structure (you should create directories in accordance with names, I.e <code>Library_session</code> would load <code>/library/session.class.php</code>)</li> <li>Model Abstraction (Account for all types of storage, Database, Disk etc)</li> <li>Error Tracking (Always make sure your logging and capturing errors)</li> </ul> <p>They are just a few tips and ideas you should be thinking about when you create your system.</p> <p>What you should also do is user other frameworks and build some sample projects, learn how an MVC Framework should be sued, so when your building one you know what the user should expect, then just really study the core structure of the framework.</p> <p>Take into consideration in PHP the following are usually how MVC Works</p> <ul> <li>Controller (this is executed depending on the URI)</li> <li>Model (Accessed from the controller and should be the I/O of Data)</li> <li>View (Templates basically)</li> </ul> <p>but you can work with a <code>MVCL</code> which is (<strong>M</strong> odel/<strong>V</strong> iew/<strong>C</strong> ontroller/<strong>L</strong> language)</p> <p>Language is not a specific in the original documentation but its been adopted a few times in regards to the pattern structure, An example of the file structure below will guide you into whats the main purpose of the <strong>+L</strong></p> <pre><code>M: \catalog\model\catalog\product.php V: \catalog\view\template\product\product.tpl C: \catalog\controller\product\product.php L: \catalog\language\english\product\product.php </code></pre> <p>An example of what company / project uses this method is: <a href="http://www.opencart.com/index.php?route=documentation/documentation&amp;path=6" rel="nofollow">OpenCart</a>, AND I HIGHY RECOMMEND YOU LOOKING AT THE ARCHITECTURE!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload