Orion PHP  0.11.12
The PHP5.3 framework
Orion\Core\Controller Class Reference
+ Inheritance diagram for Orion\Core\Controller:

List of all members.

Public Member Functions

 load ()
 allow ($slug)
 respond ($output, $exit=true, $code=null)
 getName ()

Public Attributes


Protected Attributes

 $name = null
 $route = null

Private Member Functions

 isRestrictedFunction ($name)

Private Attributes


Detailed Description

Orion controller base class.

Extend this class to create a new controller.

Thibaut Despoulain BSD 4-clauses

Definition at line 17 of file controller.php.

Member Function Documentation

Orion\Core\Controller::allow ( slug)

Allows access only to logged users that have a level equal to or less than provided role. If permission is not granted, it will automatically redirect the user to the login module.

Note that while it's doing all login/auth/redirection work automatically, you still have to create the corresponding user table in your database in addition to provide the login module into orion's module directory.

See also:
Auth MainConfig LoginModule
string$slugthe role identifier (ie: 'administrator', 'member', etc.). See your configuration file for a liste of roles and their permission level.

Reimplemented in Orion\Core\Controller\Restful.

Definition at line 92 of file controller.php.

Orion\Core\Controller::getName ( )

Returns module name identifier


Definition at line 134 of file controller.php.

Orion\Core\Controller::isRestrictedFunction ( name) [private]

Security function name testing. (Not used as of now)

stringFunction name to test
See also:

Definition at line 123 of file controller.php.

Orion\Core\Controller::load ( )

Main module function, executed right after module loading by Orion. Handles route parsing and function callbacks.

Reimplemented in Orion\Core\Controller\Template, and Orion\Core\Controller\Restful.

Definition at line 57 of file controller.php.

Orion\Core\Controller::respond ( output,
exit = true,
code = null 

Write response to output

int$codethe status code to use

Definition at line 107 of file controller.php.

Member Data Documentation

Orion::Core\Controller::$FUNCTION_NAME_MATCH = '[a-zA-Z_]+' [private]

Definition at line 51 of file controller.php.

Orion::Core\Controller::$name = null [protected]

Definition at line 31 of file controller.php.

Orion::Core\Controller::$RESTRICTED_FUNCTIONS [private]
Initial value:

Resticted functions names

Definition at line 44 of file controller.php.

Orion::Core\Controller::$route = null [protected]

Definition at line 39 of file controller.php.

const Orion::Core\Controller::FUNCTION_PREFIX = '_'

Security prefix for controller methods. Each module function name must start with this prefix.

Definition at line 23 of file controller.php.

The documentation for this class was generated from the following file: