Note that there are some explanatory texts on larger screens.

plurals
  1. POhelp understand mvc php
    primarykey
    data
    text
    <p>ok yesterday i open a thread about when to use mvc, </p> <p>today I'm about to learn how MVC frameworks work, examining some examples like CI, CAKE, etc</p> <ol> <li><p>on the .htaccess i found this</p> <p> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/?url=$1 [QSA,L] </p></li> </ol> <p>ok so when we type <a href="http://localhost/mymvc/something1/something2/something3/somethingetc" rel="nofollow noreferrer">http://localhost/mymvc/something1/something2/something3/somethingetc</a></p> <p>we got an <code>$_GET['url'] =</code>string 'something1/something2/something3/somethingetc' (length=45)</p> <p>2.so I suggest the something1 will be the class, something2 must be the function and something3 im not quite sure, how does exectly framework loads the class ?, functions ?</p> <pre><code>class Blog extends Controller { function index() { echo 'Hello World!'; } function stack() { echo 'Hello Stack!'; } } </code></pre> <p>3.ok so , i found that every framework first loads the config files, then loads a front-controller this is a front-controller ( on ci ) looks, i assume that they do like this ?</p> <blockquote> <ul> <li>extends the class ?</li> <li>they get the name of the class ? then require_once controller.nameclass.php</li> <li>then they somehow search for functions ? ( how do they do that ? )</li> <li>next they look for the default function ( function index ) then loads it ?</li> <li>if there is a client call the url /Blog/stack it loads just the Stack function, i dont >know how that work either .</li> <li>if we put $this->loadview('something') so i assume that they call the function loadview ( that is inside the Controller class and require them by the name, like require_once something.php</li> </ul> </blockquote> <p>Maybe there is a part two of this :|,</p> <p>Thanks a lot.</p> <p>Adam Ramadhan</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.
 

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