code/libraries/koowa/controller/page.php
- 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: page.php 3263 2011-05-08 22:33:06Z johanjanssens $
- Classes
- KControllerPage
Description
KControllerPage
- Extends from
- KControllerAbstract
- author
- Johan Janssens <[email protected]>
- category
- Koowa
- package
- Koowa_Controller
- uses
- KInflector
- Properties
- $_redirect
- $_redirect_message
- $_redirect_type
- $_view
- $_model
- Methods
- __construct
- _initialize
- getView
- setView
- getModel
- setModel
- setRedirect
- getRedirect
- _actionGet
- __set
- __call
Description
Abstract View Controller Class
Properties
$_model
string|object $_model = ''Model object or identifier (APP::com.COMPONENT.model.NAME)
Details
- $_model
- string|object
- visibility
- protected
- default
- final
- false
- static
- false
$_redirect
string $_redirect = 'null'URL for redirection.
Details
- $_redirect
- string
- visibility
- protected
- default
- null
- final
- false
- static
- false
$_redirect_message
string $_redirect_message = 'null'Redirect message.
Details
- $_redirect_message
- string
- visibility
- protected
- default
- null
- final
- false
- static
- false
$_redirect_type
string $_redirect_type = 'message'Redirect message type.
Details
- $_redirect_type
- string
- visibility
- protected
- default
- message
- final
- false
- static
- false
$_view
string|object $_view = ''View object or identifier (APP::com.COMPONENT.view.NAME.FORMAT)
Details
- $_view
- string|object
- visibility
- protected
- default
- final
- false
- static
- false
Methods
__call
__call(
string $method, array $args
)
:
KControllerBreadSupports a simple form Fluent Interfaces. Allows you to set the request properties by using the request property name as the method name.
For example : $controller->view('name')->limit(10)->browse();
Arguments
- $method
- string
Method name - $args
- array
Array containing all the arguments for the original call
Output
- KControllerBread
Details
- visibility
- public
- final
- false
- static
- false
- see
- http://martinfowler.com/bliki/FluentInterface.html
__construct
__construct(
object $config
)
:
Constructor
Arguments
- $config
- object
An optional KConfig object with configuration options.
Details
- visibility
- public
- final
- false
- static
- false
__set
__set(
string $property, mixed $value
)
:
Set a request properties
This function also pushes any request changes into the model
Arguments
- $property
- string
The property name. - $value
- mixed
The property value.
Details
- visibility
- public
- final
- false
- static
- false
_actionGet
_actionGet(
KCommandContext $context
)
:
string|falseSpecialised display function.
Arguments
- $context
- KCommandContext
A command context object
Output
- string|false
- The rendered output of the view or false if something went wrong
Details
- visibility
- protected
- final
- false
- static
- false
_initialize
_initialize(
object $config
)
:
voidInitializes 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
getModel
getModel(
)
:
KModelAbstractGet the model object attached to the contoller
Output
Details
- visibility
- public
- final
- false
- static
- false
getRedirect
getRedirect(
)
:
arrayReturns an array with the redirect url, the message and the message type
Output
- array
- Named array containing url, message and messageType, or null if no redirect was set
Details
- visibility
- public
- final
- false
- static
- false
getView
getView(
)
:
KViewAbstractGet the view object attached to the controller
Output
Details
- visibility
- public
- final
- false
- static
- false
setModel
setModel(
mixed $model
)
:
KControllerAbstractMethod to set a model object attached to the controller
Arguments
- $model
- mixed
An object that implements KObjectIdentifiable, an object that implements KIndentifierInterface or valid identifier string
Output
Details
- visibility
- public
- final
- false
- static
- false
- throws
- If the identifier is not a model identifier
setRedirect
setRedirect(
string $url, string $msg
=
null, string $type
=
message
)
:
KControllerAbstractSet a URL for browser redirection.
Arguments
- $url
- string
URL to redirect to. - $msg
- string
Message to display on redirect. Optional, defaults to value set internally by controller, if any. - $type
- string
Message type. Optional, defaults to 'message'.
Output
Details
- visibility
- public
- final
- false
- static
- false
setView
setView(
mixed $view
)
:
KControllerAbstractMethod to set a view object attached to the controller
Arguments
- $view
- mixed
An object that implements KObjectIdentifiable, an object that implements KIndentifierInterface or valid identifier string
Output
Details
- visibility
- public
- final
- false
- static
- false
- throws
- If the identifier is not a view identifier