YAF_REQUEST_SIMPLE(3) 1 YAF_REQUEST_SIMPLE(3)The Yaf_Request_Simple classINTRODUCTION
Yaf_Request_Simple is particularlly used for test puporse. ie. simulate some espacial request under CLI mode.
CLASS SYNOPSIS
Yaf_Request_Simple
Yaf_Request_Simpleextends
Yaf_Request_Abstract
Constants
o const string$Yaf_Request_Simple::SCHEME_HTTPhttp
o const string$Yaf_Request_Simple::SCHEME_HTTPShttps
Properties
Methods
o private void Yaf_Request_Simple::__clone (void )
o
Yaf_Request_Simple::__construct (void )
o public void Yaf_Request_Simple::get (void )
o public void Yaf_Request_Simple::getCookie (void )
o public void Yaf_Request_Simple::getFiles (void )
o public void Yaf_Request_Simple::getPost (void )
o public void Yaf_Request_Simple::getQuery (void )
o public void Yaf_Request_Simple::getRequest (void )
o public void Yaf_Request_Simple::isXmlHttpRequest (void )
Inherited methods
o public void Yaf_Request_Abstract::getActionName (void )
o public void Yaf_Request_Abstract::getBaseUri (void )
o public void Yaf_Request_Abstract::getControllerName (void )
o public void Yaf_Request_Abstract::getEnv (string $name, [string $default])
o public void Yaf_Request_Abstract::getException (void )
o public void Yaf_Request_Abstract::getLanguage (void )
o public void Yaf_Request_Abstract::getMethod (void )
o public void Yaf_Request_Abstract::getModuleName (void )
o public void Yaf_Request_Abstract::getParam (string $name, [string $default])
o public void Yaf_Request_Abstract::getParams (void )
o public void Yaf_Request_Abstract::getRequestUri (void )
o public void Yaf_Request_Abstract::getServer (string $name, [string $default])
o public void Yaf_Request_Abstract::isCli (void )
o public void Yaf_Request_Abstract::isDispatched (void )
o public void Yaf_Request_Abstract::isGet (void )
o public void Yaf_Request_Abstract::isHead (void )
o public void Yaf_Request_Abstract::isOptions (void )
o public void Yaf_Request_Abstract::isPost (void )
o public void Yaf_Request_Abstract::isPut (void )
o public void Yaf_Request_Abstract::isRouted (void )
o public void Yaf_Request_Abstract::isXmlHttpRequest (void )
o public void Yaf_Request_Abstract::setActionName (string $action)
o public bool Yaf_Request_Abstract::setBaseUri (string $uir)
o public void Yaf_Request_Abstract::setControllerName (string $controller)
o public void Yaf_Request_Abstract::setDispatched (void )
o public void Yaf_Request_Abstract::setModuleName (string $module)
o public void Yaf_Request_Abstract::setParam (string $name, [string $value])
o public void Yaf_Request_Abstract::setRequestUri (string $uir)
o public void Yaf_Request_Abstract::setRouted ([string $flag])
PROPERTIES
o $module
-
o $controller
-
o $action
-
o $method
-
o $params
-
o $language
-
o $_exception
-
o $_base_uri
-
o $uri
-
o $dispatched
-
o $routed
-
PREDEFINED CONSTANTS
o Yaf_Request_Simple::SCHEME_HTTP -
o Yaf_Request_Simple::SCHEME_HTTPS -
PHP Documentation Group YAF_REQUEST_SIMPLE(3)
Check Out this Related Man Page
YAF_PLUGIN_ABSTRACT(3) 1 YAF_PLUGIN_ABSTRACT(3)The Yaf_Plugin_Abstract classINTRODUCTION
Plugins allow for easy extensibility and customization of the framework.
Plugins are classes. The actual class definition will vary based on the component -- you may need to implement this interface, but the
fact remains that the plugin is itself a class.
A plugin could be loaded into Yaf by using Yaf_Dispatcher::registerPlugin, after registerd, All the methods which the plugin implemented
according to this interface, will be called at the proper time.
EXAMPLES
Example #1
Plugin example
<?php
/* bootstrap class should be defined under ./application/Bootstrap.php */
class Bootstrap extends Yaf_Bootstrap_Abstract {
public function _initPlugin(Yaf_Dispatcher $dispatcher) {
/* register a plugin */
$dispatcher->registerPlugin(new TestPlugin());
}
}
/* plugin class should be placed under ./application/plugins/ */
class TestPlugin extends Yaf_Plugin_Abstract {
public function routerStartup(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) {
/* before router
in this hook, user can do some url rewrite */
var_dump("routerStartup");
}
public function routerShutdown(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) {
/* router complete
in this hook, user can do login check */
var_dump("routerShutdown");
}
public function dispatchLoopStartup(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) {
var_dump("dispatchLoopStartup");
}
public function preDispatch(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) {
var_dump("preDispatch");
}
public function postDispatch(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) {
var_dump("postDispatch");
}
public function dispatchLoopShutdown(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) {
/* final hoook
in this hook user can do loging or implement layout */
var_dump("dispatchLoopShutdown");
}
}
Class IndexController extends Yaf_Controller_Abstract {
public function indexAction() {
return FALSE; //prevent rendering
}
}
$config = array(
"application" => array(
"directory" => dirname(__FILE__) . "/application/",
),
);
$app = new Yaf_Application($config);
$app->bootstrap()->run();
?>
The above example will output something similar to:
string(13) "routerStartup"
string(14) "routerShutdown"
string(19) "dispatchLoopStartup"
string(11) "preDispatch"
string(12) "postDispatch"
string(20) "dispatchLoopShutdown"
CLASS SYNOPSIS
Yaf_Plugin_Abstract
Yaf_Plugin_Abstract
Methods
o public void Yaf_Plugin_Abstract::dispatchLoopShutdown (Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
o public void Yaf_Plugin_Abstract::dispatchLoopStartup (Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
o public void Yaf_Plugin_Abstract::postDispatch (Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
o public void Yaf_Plugin_Abstract::preDispatch (Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
o public void Yaf_Plugin_Abstract::preResponse (Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
o public void Yaf_Plugin_Abstract::routerShutdown (Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
o public void Yaf_Plugin_Abstract::routerStartup (Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
PHP Documentation Group YAF_PLUGIN_ABSTRACT(3)