5 ms·
I never use frameworks... I don't really see the point. Most of the time it's just a few SQL queries and a few if statements.
by Limes102 16y ago
I never use frameworks... I don't really see the point. Most of the time it's just a few SQL queries and a few if statements.
- tintin 16y agoI have to agree with you. I'm using PHP for over 10 years now and I never needed a framework. Sometimes a little class or function is convenient but that's about it. Even for very big projects. Just use Apache/IIS/other as controller.
- rimantas 16y ago> Just use Apache/IIS/other as controller. You must have some really interesting understanding what controller is…
- lftl 16y agoHe didn't elaborate but it's a valid point in the PHP world. Most of the PHP frameworks implement a front controller that all application requests are sent through, but for a lot of applications this isn't necessary in the PHP world. There's no reason not to simply divide your application into separate files and let your webserver call the right file. Particularly interesting is how similar mod_rewrite is to many framework's routes type implementation. You can practically stick the same config in .htaccess and just let Apache handle it. For a lot of simple applications my "controller" consists of: if($_SERVER['REQUEST_METHOD'] == 'POST') { // do my validation and any work needed then the redirect } else { // display the resource } You might still call that a "controller" but it's pretty different than what most of the frameworks call a controller, and we've pushed the task of routing the request to the right piece of code off to Apache.
- tintin 16y agoFrom Wikipedia: A controller accepts input from the user and instructs the model and viewport to perform actions based on that input. Well ofcourse there are differences, but your webserver reacts to input from the user (a request) and tells the server which code to execute.