Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'd say "just call your route" but it seems that your design actually hasn't any routes...but I come to that later.</p> <p>So for now you've got to</p> <ol> <li>Call the script again, checking if the method by which the site was called is POST and then call your Controller method</li> <li>Create a second script, maybe called <code>registreer.php</code> which is called when submitting the form, where you call the Controller method</li> </ol> <p>The above example will not work, because you're basically calling your method <code>Controller::registreer()</code> and inserting the returned results from it (if it has any, in this case it hasn't) into the <code>action</code> attribute from your <code>&lt;form&gt;</code> tag.</p> <p>If you want to actually have the file <code>registreer.php</code> to be called on form submission just write it into the <code>action</code> attribute.</p> <hr> <p>Anyway, that's not a quite good design - due to the fact that your going to have some kind of <em>Controller</em> in your code it would be the best practice to actually create <em>Routes</em> which are calling methods you define.</p> <p>Have a look at <a href="http://www.sitepoint.com/the-mvc-pattern-and-php-1/" rel="nofollow">this tutorial</a> to get a clue about what MVC actually is.</p> <p>After that I recommend you to use one of the many many many MVC frameworks available out there.</p> <p>Two of my favorites are</p> <ul> <li><a href="http://silex.sensiolabs.org/" rel="nofollow">Silex</a>, a micro framework, mainly giving you the change to create fast and easily routes for your application</li> <li><a href="http://www.slimframework.com/" rel="nofollow">Slim</a>, yet another micro framework</li> <li><a href="http://laravel.com/" rel="nofollow">Laravel</a>, nice to use framework</li> </ul> <p>If you think you've got the idea and want to get deeper, have a look at the "bigger" frameworks, like</p> <ul> <li><a href="http://symfony.com/" rel="nofollow">Symfony2</a>, not just a MVC framework, comes with a bunch of additional components (called bundles)</li> <li><a href="http://framework.zend.com/" rel="nofollow">Zend Framework</a>, another one</li> </ul> <p>Those are just five examples of many frameworks out there. Go and grab one.</p>
 

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