PHP Class Habari\ActionHandler

Show file Open project: habari/system

Public Properties

Property Type Description
$action string Name of action to trigger
$handler_vars SuperGlobal Internal array of handler variables (state info)
$theme Theme Storage for the theme used, if created

Public Methods

Method Description
__call ( string $function, array $args ) Helper method to convert calls to $handler->my_action() to $handler->act('my_action');
act ( string $action ) All handlers must implement act() to conform to handler API.
act_redirect ( ) Helper method to allow RewriteRules to send a redirect. The method will redirect to the build_str of the RewriteRule if matched.
setup_theme ( ) Load the active theme and create a new Theme instance.

Method Details

__call() public method

Helper method to convert calls to $handler->my_action() to $handler->act('my_action');
public __call ( string $function, array $args )
$function string function name
$args array function arguments

act() public method

This is the default implementation of act(), which attempts to call a class member method of $this->act_$action(). Any subclass is welcome to override this default implementation.
public act ( string $action )
$action string the action that was in the URL rule

act_redirect() public method

Helper method to allow RewriteRules to send a redirect. The method will redirect to the build_str of the RewriteRule if matched.
public act_redirect ( )

setup_theme() public method

Also, assign the request variables.
public setup_theme ( )

Property Details

$action public property

Name of action to trigger
See also: act()
public string $action
return string

$handler_vars public property

Internal array of handler variables (state info)
public SuperGlobal,habari $handler_vars
return SuperGlobal

$theme public property

Storage for the theme used, if created
public Theme,habari $theme
return Theme