The Yaf_Bootstrap_Abstract class
(No version information available, might only be in Git)
Introduction
Bootstrap is a mechanism used to do some intial config before a Application run.
User may define their own Bootstrap class by inheriting Yaf_Bootstrap_Abstract
Any method declared in Bootstrap class with leading "_init", will be called by Yaf_Application::bootstrap() one by one according to their defined order.
Examples
Example #1 Bootstrap example
<?php
/* bootstrap class should be defined under ./application/Bootstrap.php */
class Bootstrap extends Yaf_Bootstrap_Abstract {
public function _initConfig(Yaf_Dispatcher $dispatcher) {
var_dump(__METHOD__);
}
public function _initPlugin(Yaf_Dispatcher $dispatcher) {
var_dump(__METHOD__);
}
}
$config = array(
"application" => array(
"directory" => dirname(__FILE__) . "/application/",
),
);
$app = new Yaf_Application($config);
$app->bootstrap();
?>
The above example will output something similar to:
string(22) "Bootstrap::_initConfig" string(22) "Bootstrap::_initPlugin"
Class synopsis
abstract
Yaf_Bootstrap_Abstract
{
/* Properties */
/* Methods */
}- Введение
- Установка и настройка
- Предопределенные константы
- Примеры
- Application Configuration
- The Yaf_Application class
- The Yaf_Bootstrap_Abstract class
- The Yaf_Dispatcher class
- The Yaf_Config_Abstract class
- The Yaf_Config_Ini class
- The Yaf_Config_Simple class
- The Yaf_Controller_Abstract class
- The Yaf_Action_Abstract class
- The Yaf_View_Interface class
- The Yaf_View_Simple class
- The Yaf_Loader class
- The Yaf_Plugin_Abstract class
- The Yaf_Registry class
- The Yaf_Request_Abstract class
- The Yaf_Request_Http class
- The Yaf_Request_Simple class
- The Yaf_Response_Abstract class
- The Yaf_Route_Interface class
- The Yaf_Route_Map class
- The Yaf_Route_Regex class
- The Yaf_Route_Rewrite class
- The Yaf_Router class
- The Yaf_Route_Simple class
- The Yaf_Route_Static class
- The Yaf_Route_Supervar class
- The Yaf_Session class
- The Yaf_Exception class
- The Yaf_Exception_TypeError class
- The Yaf_Exception_StartupError class
- The Yaf_Exception_DispatchFailed class
- The Yaf_Exception_RouterFailed class
- The Yaf_Exception_LoadFailed class
- The Yaf_Exception_LoadFailed_Module class
- The Yaf_Exception_LoadFailed_Controller class
- The Yaf_Exception_LoadFailed_Action class
- The Yaf_Exception_LoadFailed_View class
Коментарии
404 Not Found