In the current framework version, the routing of HTTP requests to the app backend is not configurable and works according to fixed rules (which can, however, be overridden inside an individual app).
The common backend of all apps is accessible within address space
http://[domain_name]/[webasyst_root_path]/webasyst/*. The backend of each app is accessible within
where APP_ID is the app identifier.
Relationship between the request URL and the class and method called for its processing is defined by the front controller class. By default (if
an app does not have its own front controller) system class
waFrontController is used, which works in accordance with the rules
System front controller operating logic
App backend is accessible via URLs of the form
waFrontController executes a specific module and an action of the requested app based on the values of parameters
module and action retrieved from the GET request. Both parameters (module and action) are optional; if they are not
specified, default class and method selection rules are applied. The default value for parameter module is
backend. System front
waFrontController searches a class and a method according to the rules described in section
Naming rules and recommendations.
Examples of relationship between request URLs and module methods
Below are shown examples of the module/method search algorithm operation for a sample app with identifier
The system searches for a class and a method in the order shown above and executes the first found variant.
Overriding backend routing rules
If the routing rules of your app backend require modification of the default routing logic, you need to override the front controller for your
app. To do so, create a new class extending base class
waFrontController. Implement the request routing logic in its method
Then add the following line to file
'front_controller' => 'your_class_name'
For example, if your app's front controller class name is
myblogFrontController, then file
factories.php should have
the following contents:
<?php return [ ... 'front_controller' => 'myblogFrontController', ];