Documentation

Router
in package

Router

Table of Contents

Properties

$arguments  : mixed
Arguments to pass to controller method
$complete_uri  : mixed
Original URI and query string combined.
$controller  : mixed
Controller to use
$current_uri  : mixed
The original URI requested e.g. by a HTTP user agent or via CLI
$method  : mixed
Method to call on controller
$query_string  : mixed
Original query string requested by HTTP user agent
$routed_uri  : mixed
Controller/method URI to use, from the configured routes
$url_suffix  : mixed
Optional fake file extension that will be added to all generated URLs, e.g. '.html'
$router  : Router

Methods

findUri()  : void
Attempts to determine the current URI using CLI, GET, PATH_INFO, ORIG_PATH_INFO, or PHP_SELF.
getRoutes()  : array<string|int, mixed>
Get the routes tables.
originCleanup()  : void
Redirect to alternate hostname and/or protocol if requred
routedUri()  : string|bool
Generates routed URI (i.e. controller/method/arg1/arg2/...) from given URI.
setup()  : void
Router setup routine; determines controller/method from URI.
originCleanupDebug()  : void
Output information about origin cleanup, and then exit This is turned on by the BootstrapConfig::ORIGIN_CLEANUP_DEBUG constant

Properties

$arguments

Arguments to pass to controller method

public static mixed $arguments = []

$complete_uri

Original URI and query string combined.

public static mixed $complete_uri = ''

$controller

Controller to use

public static mixed $controller

$current_uri

The original URI requested e.g. by a HTTP user agent or via CLI

public static mixed $current_uri = ''

$method

Method to call on controller

public static mixed $method = 'index'

$query_string

Original query string requested by HTTP user agent

public static mixed $query_string = ''

$routed_uri

Controller/method URI to use, from the configured routes

public static mixed $routed_uri = ''

$url_suffix

Optional fake file extension that will be added to all generated URLs, e.g. '.html'

public static mixed $url_suffix = ''

Methods

findUri()

Attempts to determine the current URI using CLI, GET, PATH_INFO, ORIG_PATH_INFO, or PHP_SELF.

public static findUri() : void

getRoutes()

Get the routes tables.

public static getRoutes() : array<string|int, mixed>
Return values
array<string|int, mixed>

originCleanup()

Redirect to alternate hostname and/or protocol if requred

public static originCleanup() : void

The actual business rules for the desired protocol/hostname is defined in the BootstrapConfig class which is located at config/_bootstrap_config.php

Return values
void —

Redirects (301) if protocol and/or hostname should change

routedUri()

Generates routed URI (i.e. controller/method/arg1/arg2/...) from given URI.

public static routedUri(string $uri) : string|bool
Parameters
$uri : string

URI to convert, e.g. 'admin/edit/page/3'

Tags
throws
Exception

if no routes configured

Return values
string|bool —

Routed URI or false, e.g. 'AdminController/edit/page/3'

setup()

Router setup routine; determines controller/method from URI.

public static setup() : void

Automatically called during Kohana setup process.

originCleanupDebug()

Output information about origin cleanup, and then exit This is turned on by the BootstrapConfig::ORIGIN_CLEANUP_DEBUG constant

private static originCleanupDebug(string $old_proto, string $old_hostname, string $new_proto, string $new_hostname) : void
Parameters
$old_proto : string
$old_hostname : string
$new_proto : string
$new_hostname : string
Return values
void —

Terminates script execution

On this page

Search results