Skip to content

Latest commit

 

History

History
114 lines (100 loc) · 6.4 KB

overview.md

File metadata and controls

114 lines (100 loc) · 6.4 KB

An overview of Minz classes

It might be intimidating to dig into the source code of a framework. This chapter is here to guide you. Hopefully, there’s not too many components in Minz so we’ll soon have covered it all.

Note that I only make quick presentations here. You’ll have to read the code and the comments to learn how to use these classes.

I have highlighted the classes that I believe are the most important of Minz. You’ll often have to interact with them.

Core classes

  • \Minz\Configuration loads and stores your configuration;
    • \Minz\Dotenv is often used in configuration files, to load environment variables;
  • \Minz\Request abstracts HTTP or CLI requests;
  • \Minz\Response abstracts HTTP or CLI responses, it embeds a \Minz\Output (interface) which is in charge of rendering the content. Here is the list of available outputs:
  • \Minz\Router is in charge of the routing of your application;
  • \Minz\Url renders the URLs of your application, using the information from the router;
  • \Minz\Engine does the plumbing of your application, executing a controller action based on a given request and returning its response;

To learn how to use these classes, read the “getting started” guide.

Models and database

Additional classes

The three last classes are very useful during tests!

Tests

Finally, Minz provides a bunch of helpers and assertions for PHPUnit: