What are colors and routers in various PHP frameworks

Asked

Viewed 32 times

0

I’ve always used PHP without a framework. I use the MVC standard, but I only created a pro view folder, a pro controller and a pro model, but recently I decided to study a framework and it uses such a core and routers. I asked the teacher but he did not answer me (the course is online). There is another PHP course that I acquired recently, the idea of it is to use PHP "pure" to create our own framework, but again the course was going well until arriving at the core and router part

1 answer

0


Core

is where all the logic and "heart" of the framework is, in this folder are all the necessary settings for the framework to work. Never touch this briefcase unless you know what you’re doing.

Router

Router means router or routes and is the folder where the "paths" of your application are, in which you define which URL will be used in your project, for example;

localhost:8080/rota1/subrota

rota1and subrota will be defined in the file/folder of router and they led to a specific code that you define.

  • I may be talking nonsense, but in the case of Core, wouldn’t it be the same thing to simply create a file called Config? and in the case of Router, it’s not the same autoload thing?

  • basically yes but the framework have many features already built in so that you do not need to worry about heavy configuration for example send emails, save files in the cloud and etc. the router follows the same principle, in it Oce will already have configurations ready for login, logout and etc. when you start studying pure PHP and create your own framework as said Voce will be able to better understand but for now good studies! :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.