code/libraries/koowa/controller/abstract.php

Classes
category
Koowa
copyright
Copyright (C) 2007 - 2010 Johan Janssens. All rights reserved.
license
GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
link
http://www.nooku.org
package
Koowa_Controller
version
$Id: abstract.php 3234 2011-05-03 11:25:50Z johanjanssens $
Classes
KControllerAbstract

Description

KControllerAbstract

Extends from
KObject
Implements
KObjectIdentifiable
author
Johan Janssens <[email protected]>
category
Koowa
package
Koowa_Controller
uses
KMixinClass
uses
KCommandChain
uses
KObject
uses
KFactory
Properties
$_action_map
$_actions
$_dispatched
$_request
$_behaviors
Methods
__construct
_initialize
getIdentifier
isDispatched
execute
getActions
getRequest
setRequest
addBehavior
getBehavior
getBehaviors
registerActionAlias
__set
__get
__call

Description

Abstract Controller Class

Note: Concrete controllers must have a singular name

Properties

$_action_map

array $_action_map = 'array'

Array of class methods to call for a given action.

Details

$_action_map
array
visibility
protected
default
array
final
false
static
false

$_actions

array $_actions = ''

The class actions

Details

$_actions
array
visibility
protected
default
final
false
static
false

$_behaviors

array $_behaviors = 'array'

List of behaviors

Associative array of behaviors, where key holds the behavior identifier string and the value is an identifier object.

Details

$_behaviors
array
visibility
protected
default
array
final
false
static
false

$_dispatched

boolean $_dispatched = ''

Has the controller been dispatched

Details

$_dispatched
boolean
visibility
protected
default
final
false
static
false

$_request

array $_request = 'null'

The request information

Details

$_request
array
visibility
protected
default
null
final
false
static
false

Methods

__call

__call( string $method, array $args ) :

Execute a controller action by it's name.

Function is also capable of checking is a behavior has been mixed succesfully using is[Behavior] function. If the behavior exists the function will return TRUE, otherwise FALSE.

Arguments
$method
string
Method name
$args
array
Array containing all the arguments for the original call
Details
visibility
public
final
false
static
false
see
execute()

__construct

__construct( object $config = null ) :

Constructor.

Arguments
$config
object
An optional KConfig object with configuration options.
Details
visibility
public
final
false
static
false

__get

__get( string $property ) : string

Get a request property

Arguments
$property
string
The property name.
Output
string
The property value.
Details
visibility
public
final
false
static
false

__set

__set( string $property, mixed $value ) :

Set a request properties

Arguments
$property
string
The property name.
$value
mixed
The property value.
Details
visibility
public
final
false
static
false

_initialize

_initialize( object $config ) : void

Initializes the default configuration for the object

Called from {@link __construct()} as a first step of object instantiation.

Arguments
$config
object
An optional KConfig object with configuration options.
Details
visibility
protected
final
false
static
false

addBehavior

addBehavior( array $behaviors ) : KControllerAbstract

Register one or more behaviors to the controller

Arguments
$behaviors
array
Array of one or more behaviors to add.
Details
visibility
public
final
false
static
false

execute

execute( string $action, object $context ) : mixed|false

Execute an action by triggering a method in the derived class.

Arguments
$action
string
The action to execute
$context
object
A command context object
Output
mixed|false
The value returned by the called method, false in error case.
Details
visibility
public
final
false
static
false
throws

getActions

getActions( $reload = false ) : array

Gets the available actions in the controller.

Arguments
$reload
Output
array
Array[i] of action names.
Details
visibility
public
final
false
static
false

getBehavior

getBehavior( $behavior, $config = array ) : KControllerBehaviorAbstract

Get a behavior by identifier

Arguments
$behavior
$config
Details
visibility
public
final
false
static
false

getBehaviors

getBehaviors( ) : array

Gets the behaviors of the table

Output
array
An asscociate array of table behaviors, keys are the behavior names
Details
visibility
public
final
false
static
false

getIdentifier

getIdentifier( ) : KIdentifier

Get the object identifier

Output
KIdentifier
Details
visibility
public
final
false
static
false
see
KObjectIdentifiable

getRequest

getRequest( ) : KConfig

Get the request information

Output
KConfig
A KConfig object with request information
Details
visibility
public
final
false
static
false

isDispatched

isDispatched( ) : boolean

Has the controller been dispatched

Output
boolean
Returns true if the controller has been dispatched
Details
visibility
public
final
false
static
false
see
KObjectIdentifiable

registerActionAlias

registerActionAlias( string $alias, string $action ) : KControllerAbstract

Register (map) an action to a method in the class.

Arguments
$alias
string
The action.
$action
string
The name of the method in the derived class to perform for this action.
Details
visibility
public
final
false
static
false

setRequest

setRequest( array $request ) : KControllerBread

Set the request information

Arguments
$request
array
An associative array of request information
Output
KControllerBread
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox 0.10.0.