Welcome to FrostSW!

FrostMVC PHP Framework

Documentation   |   Version

Controller

FrostMVC\Controller

use FrostMVC\Controller;

Base controller class for all FrostMVC controllers.

Provides URL-segment routing via route(), which maps the first URL segment to a public method on the subclass and passes the remaining segments as positional arguments.

Properties

PropertyTypeDescription
$require FrostMVC\Loader

Methods

->__construct() —
->route()

Dispatches the request to the appropriate method based on URL segments. Falls back to index() when no segments are provided.

__construct()

$controller->__construct($pages = '')

No description yet.

Parameters

$pages mixed Default: ''

route()

$controller->route($pages)

Dispatches the request to the appropriate method based on URL segments. Falls back to index() when no segments are provided.

Parameters

$pages array

URL path segments: [methodName, arg1, arg2, ...].

Generated from core/classes/Controller.php (FrostMVC ).