Introduction to PHP microframework Dispatch. Dispatch is a small PHP framework. It does not give you complete MVC settings, but you can define URL rules and methods to better organize applications. This is a small PHP Framework for API, simple site, or prototype. It does not give you complete MVC settings, but you can define URL rules and methods to better organize applications. This is perfect for APIs, simple sites, or prototypes.
The code is as follows:
// Include database
Include 'Dispatch. php ';
// Define your route
Get ('/greet', function (){
// Rendering view
Render ('Greet-form ');
});
// Post processing
Post ('/greet', function (){
$ Name = from ($ _ POST, 'name ');
// Render a view while passing some locals
Render ('Greet-show', array ('name' => $ name ));
});
// Serve your site
Dispatch ();
You can match a specific type of HTTP request and path, render the view, or do more. If you merge Dispatch and other frameworks, you can have a very powerful and lightweight program!
Bytes. It does not give you complete MVC settings, but you can define URL rules and methods to better organize applications. For API, simple site, or prototype...