routing

Allows to add custom routing rules for frontend requests.

Files

Input (passed by reference)

$route array App’s current settlement’s parameters.
… your plugin code …

Output

$routes

Custom routing rules in the form of an associative array similar to those contained in the app’s file routing.php.

Files

Plugin code example

PHP

public function routingHandler($route)
{
    return [
        // short format
        'myplugin/page/' => 'frontend/page',
        
        // extended format
        'myplugin/section/' => [
            'module' => 'frontend',
            'action' => 'section',
        ],
    ];
}