# PHPFast Overview

## Framework Struct Overview

First, you need to get an overview of the structure of the Framework's parts:

[Application Structure](/framework-overview/application-structure.md)

[Models, Views and Controllers](/framework-overview/models-views-and-controllers.md)

[Libraries Overview](/framework-overview/libraries-overview.md)

[Helpers Overview](/framework-overview/helpers-overview.md)

[Command-Line (CLI)](/framework-overview/command-line-cli.md)

## Framework Document Overview

PHPFast is a lightweight and efficient PHP framework designed to optimize the web application development process. Below is a detailed guide on how to use the main components of PHPFast:

## [Core](/documents/core.md)

* Core refers to the essential components of the framework, including classes for request handling, routing, application initialization, and other necessary components for the application to function.
* The core is automatically initialized when you run your PHPFast application. You don’t need to intervene in the core framework unless you want to extend or modify how the framework operates. PHPFast will handle all user requests, perform routing, and call the appropriate controller to handle the request.

## [Routing](/documents/uri-routing.md)

* Routing in PHPFast maps URLs to specific controller methods. This allows you to define paths and methods to handle requests for each URL.
* To define a route, you will use the `Route` class. Each route will have a specific path, an HTTP method (GET, POST, etc.), and the controller method that will handle the request. Routes can be grouped by modules or features of the application.

## [Controllers](/documents/controllers.md)

* Controllers are responsible for handling user requests, performing necessary operations, and returning results, which can be either a view or a JSON response.
* Controllers are defined as PHP classes, and each method within a controller handles a specific request. The methods in controllers can interact with models to fetch data, process business logic, and return results.

## [Models](/documents/models.md)

* Models represent the data layer of the application and perform operations on the database.
* Models are used to interact with the database and perform actions like querying, inserting, updating, or deleting data. A model typically represents a table in the database, and methods in the model perform the corresponding operations.

## [ Views & Templates](/documents/views-and-templates.md)

* Views are responsible for rendering the user interface of the application, while Templates are dynamic HTML layouts used for reusing parts of the UI.
* Views can be loaded and rendered with dynamic data, allowing information from the controller to be displayed to the user. Templates help separate logic and interface, making maintenance and changes to the UI easier.

## [Blocks](/documents/blocks.md)

* The `BaseBlock` class is an abstract class in the PHPFast framework designed to manage the blocks within an application. It provides a structure for defining blocks, storing their associated data, and rendering their content.&#x20;
* This class serves as a foundation for creating customizable blocks in the application, ensuring consistency and reusability.

## [Middleware](/documents/middleware.md)

* Middleware are intermediary classes that allow you to intervene in the request and response chain before they are processed by the controller or after the controller returns a response.
* Middleware is commonly used for tasks such as user authentication, access control, logging, or validating input before further processing. Middleware can be applied to a specific route or to the entire application.

## [Helpers](/documents/helpers.md)

* Helpers are utility functions that simplify common programming tasks such as working with strings, arrays, and validating data.
* PHPFast provides several built-in helpers to support tasks like generating URLs, processing strings, or handling forms. You can call these helper functions directly from anywhere in the application without needing to instantiate additional objects.

## [Libraries](/documents/libraries.md)

* Libraries provide additional functionality such as logging, session management, or handling external requests like emails, SMS, etc.
* You can use the framework's libraries to access and utilize complex features without having to write custom code. These libraries can be loaded and used in controllers or models to handle specific tasks.

## [Drivers](/documents/drivers.md)

* **Description**: Drivers provide specialized services such as database connections, email sending, or caching. Drivers help integrate external services into your application.
* **Usage**: Drivers can be loaded and used to perform specific tasks, such as connecting to a database or managing cache. Each driver corresponds to a specific service and helps you perform related operations.

## [Commands](/documents/commands.md)

* Commands allow you to perform tasks from the command line (CLI) such as database migrations, clearing cache, or running background jobs.
* To create custom commands, you will define a new command class, extending the `Command` class. These commands can then be run from the command line to perform tasks automatically without needing to intervene in the source code.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cmsfullform.com/framework-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
