Framework documentation
https://secure.gravatar.com/avatar/b28e536690cbbcc42568497fe280b4f4.png?d=wavatar&s=28
Fri Jul 02 16:43 Authored by zegenie

The framework used in Pachno borrows concepts from modern php frameworks such as Symfony, Laravel and others. If you're used to writing modern php applications, you'll feel right at home with the MVC framework used in Pachno.

Overview

The core framework consists of several classes working together to handle everything from bootstrapping, caching, logging, routing, response handling and a lot more.

You will find the framework in the pachno\core\framework namespace. All classes mentioned in this overview are in this namespace.

Component Classes Description
Caching Cache Handles retrieving and storing items in the cache. Can be utilized by modules to cache data on demand.
Controller and Routing ControllerRequestRouting Takes care of routing requests by mapping the url to their corresponding controller methods
Debugging Debugger Tools and utilities for debugging pachno and its modules. Includes a debugging toolbar and useful tools.
Events Event Dispatches events and handles passing data to and from listeners.
Localization I18n Handles translating text and formatting data according to the specified locale
Logging Logging Handles logging, including different log levels and outputting to log files.
Templating ActionComponentJsonOutputResponseTextOutput Handles outputting data to the user.

Templates

Templating in Pachno is done using regular .php files and no specific templating language. Parameters and variables are passed to templates through the controllers, and some "global" variables such as the user object, current project, request and response are always available in the template.

Variables available to all templates

Variable name Description
$pachno_request The current request.
$pachno_routing The current route information.
$pachno_response The response object.
$pachno_user The current user - either authenticated or a guest user.

Storing and retrieving data from the database

Pachno uses the B2db framework for data persistence. This ORM framework handles transforming data objects to and from the database, as well as providing methods for querying the database.

All the database entities and their corresponding table classes are available in the pachno\core\entities and pachno\core\entities\tables namespaces.

Attachments 0

Comments 0

/unthemed/mono/no-comments.png
Expand, collaborate and share
Post a comment and get things done