v0

Conventions

Follow these conventions to create top-quality Hubleto code.

The conventions for the development of Hubleto ERP apps are divided into several categories. Each category is described in separate chapter.

Hint: If you are using AI to help you create the Hubleto code, you may directly point the agent to this page and force him to follow these conventions.

Namespace

Files and folder structure

Folder structure of each app shall be following:

Minimal configuration

Models (files)

Controllers (files)

Views (files)

App loader

URLs and routing

It is recommended, but not strictly required, that routing table shall route the snake-case and lowercase version of the controllers name to the appropriate controller.

For example, route to the Customers/Api/DeactivateCustomer controller shall be customers/api/deactivate-customer.

If a "CRUD functionality" is required, routes shall be implemented followingly (examples are for the Customer model):

Models and their record managers

A model shall contain at least:

Optionally, a model can contain:

A model's record manager shall contain at least:

Controllers

There are mostly two types of controllers:

If a controllers sets a view, it shall call the setView() method at the end of its prepareView(). The view set shall have the same name as the controller. For example, a view for Customers.php controller shall be Customers.twig.

If a controller returns a JSON, the response shall be returned from renderJson() method.

Views

To be described later.

« Previous page
Next page »
www.hubleto.com | Found a bug or missing something? Report an issue via GitHub.