PHP Class Habari\Controller

Inheritance: extends Singleton
Show file Open project: habari/system Class Usage Examples

Public Properties

Property Type Description
$base_url

Public Methods

Method Description
dispatch_request ( ) Handle the requested action by firing off the matched handler action(s)
get_action ( ) : string Returns the action
get_base_url ( ) : string Returns the base URL
get_full_url ( ) : string Returns the full requested URL
get_handler ( ) : ActionHandler Returns the action handler
get_handler_vars ( ) : array Returns the action handler's variables
get_matched_rule ( ) : RewriteRule | null A convenience method for returning the rewrite rule that matches the requested URL
get_request_obj ( ) : stdClass Get an object that represents the request made
get_stub ( ) : string Returns the stub in its entirety
get_var ( string $name, mixed $default = null ) : mixed A convenience method for returning a handler variable (handler_var).
parse_request ( ) Parses the requested URL. Automatically translates URLs coming in from mod_rewrite and parses out any action and parameters in the slug.

Protected Methods

Method Description
instance ( ) Enables singleton working properly

Method Details

dispatch_request() public static method

Handle the requested action by firing off the matched handler action(s)
public static dispatch_request ( )

get_action() public static method

Returns the action
public static get_action ( ) : string
return string name of action

get_base_url() public static method

Returns the base URL
public static get_base_url ( ) : string
return string base URL

get_full_url() public static method

Returns the full requested URL
public static get_full_url ( ) : string
return string The full requested URL

get_handler() public static method

Returns the action handler
public static get_handler ( ) : ActionHandler
return ActionHandler handler object

get_handler_vars() public static method

Returns the action handler's variables
public static get_handler_vars ( ) : array
return array variables used by handler

get_matched_rule() public static method

A convenience method for returning the rewrite rule that matches the requested URL
public static get_matched_rule ( ) : RewriteRule | null
return RewriteRule | null The rule that matches the requested URL

get_request_obj() public static method

Get an object that represents the request made
public static get_request_obj ( ) : stdClass
return stdClass An object with properties named after rewrite rules, which are true if those rules were used to handle the current request

get_stub() public static method

Returns the stub in its entirety
public static get_stub ( ) : string
return string the URL incoming stub

get_var() public static method

This includes only parameters set on the url. The alternative to this, while possible to write, is just too long.
public static get_var ( string $name, mixed $default = null ) : mixed
$name string The name of the variable to return.
$default mixed A default value to return if the variable is not set.
return mixed The value of that variable in the handler

instance() protected static method

Enables singleton working properly
protected static instance ( )

parse_request() public static method

Parses the requested URL. Automatically translates URLs coming in from mod_rewrite and parses out any action and parameters in the slug.
public static parse_request ( )

Property Details

$base_url public property

public $base_url