|
The Yaf_Controller_Abstract classIntroductionYaf_Controller_Abstract is the heart of Yaf's system. MVC stands for Model-View-Controller and is a design pattern targeted at separating application logic from display logic. Every custom controller shall inherit Yaf_Controller_Abstract. Since Yaf_Controller_Abstract::__construct is called by Yaf with no arguments, Yaf_Controller_Abstract provides an alternative constructor-like hook: Yaf_Controller_Abstract::init. If you have defined a init() method in your custom controller, it will be called as long as the controller was instantiated. Action may have arguments, when a request coming, if there are the same name variable in the request parameters(see Yaf_Request_Abstract::getParam) after routed, Yaf will pass them to the action method (see Yaf_Action_Abstract::execute).
Class synopsisYaf_Controller_Abstract
abstract
class Yaf_Controller_Abstract
{
/* Properties */
protected
$actions;
protected
$_module;
protected
$_name;
protected
$_request;
protected
$_response;
protected
$_invoke_args;
protected
$_view;
/* Methods */
public __construct()
protected boolnull display(string
$tpl, arraynull $parameters = ?)public boolnull forward(string
$action, arraynull $parameters = ?)public stringnull getInvokeArg(string
$name)public arraynull getInvokeArgs()
public stringnull getModuleName()
public stringnull getName()
public Yaf_Request_Abstractnull getRequest()
public Yaf_Response_Abstractnull getResponse()
public Yaf_View_Interfacenull getView()
public stringnull getViewpath()
public void init()
public Yaf_View_Interfacenull initView(arraynull
$options = ?)public boolnull redirect(string
$url)protected stringboolnull render(string
$tpl, arraynull $parameters = ?)public boolnull setViewpath(string
}$view_directory)Properties
|