Menu

Enter the framework - some ideas

Some time ago, I met Codeigniter (i think it was version 1.7) and got amazed by the idea that only one entry file recevies every request (index.php) , and as soon framework starts, it parses the URI and redirects everything to the right controller / function. That crush was so intense that until today I found that a really comfortable approach, and that will be my first move. To keep that strategy. Here's the basic diagram:

With all that been said, here are my real first php steps:

  • manage everything from index.php
  • index.php will instatiate the framework
  • controller/view approach will be used (i'm not fan in a webapp like this one to have an extra model file, I prefer to manage all the model logic right into the controller)
  • framework by now will load some basic config in a public array (this will be reviewed in the future, but so far I need to start somewhere)
  • framework will parse the uri and sanitize its values (pass as shown in the graphic, the parameters to controller)
  • index.php will have a boolean to indicate if we are in debug mode or not
  • framework will have a generic error page, and if in debug mode will show error details. If not, just a generic message

Now, it is time to code, test and commit :)

Posted by augusto wloch 2020-03-15 Labels: framework
Attachments:

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.