Yaf_Dispatcher::getApplication
(Yaf >=1.0.0)
Yaf_Dispatcher::getApplication — Retrive the application
Описание
Retrive the Yaf_Application instance. same as Yaf_Application::app().
Список параметров
У этой функции нет параметров.
Возвращаемые значения
Смотрите также
- Yaf_Application::app() - Retrieve an Application instance
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Другие базовые расширения
- Yet Another Framework
- Функция Yaf_Dispatcher::autoRender() - Switch on/off autorendering
- Функция Yaf_Dispatcher::catchException() - Switch on/off exception catching
- Функция Yaf_Dispatcher::__clone() - Yaf_Dispatcher can not be cloned
- Функция Yaf_Dispatcher::__construct() - Yaf_Dispatcher constructor
- Функция Yaf_Dispatcher::disableView() - Disable view rendering
- Функция Yaf_Dispatcher::dispatch() - Dispatch a request
- Функция Yaf_Dispatcher::enableView() - enable view rendering
- Функция Yaf_Dispatcher::flushInstantly() - Switch on/off the instant flushing
- Функция Yaf_Dispatcher::getApplication() - Retrive the application
- Функция Yaf_Dispatcher::getInstance() - Retrive the dispatcher instance
- Функция Yaf_Dispatcher::getRequest() - Retrive the request instance
- Функция Yaf_Dispatcher::getRouter() - Retrive router instance
- Функция Yaf_Dispatcher::initView() - Initialize view and return it
- Функция Yaf_Dispatcher::registerPlugin() - Register a plugin
- Функция Yaf_Dispatcher::returnResponse() - The returnResponse purpose
- Функция Yaf_Dispatcher::setDefaultAction() - Change default action name
- Функция Yaf_Dispatcher::setDefaultController() - Change default controller name
- Функция Yaf_Dispatcher::setDefaultModule() - Change default module name
- Функция Yaf_Dispatcher::setErrorHandler() - Set error handler
- Функция Yaf_Dispatcher::setRequest() - The setRequest purpose
- Функция Yaf_Dispatcher::setView() - Set a custom view engine
- Функция Yaf_Dispatcher::__sleep() - Yaf_Dispatcher can not be serialized
- Функция Yaf_Dispatcher::throwException() - Switch on/off exception throwing
- Функция Yaf_Dispatcher::__wakeup() - Yaf_Dispatcher can not be unserialized
Коментарии
Here is an example of how you can get the instance of Yaf_Application from somewhere in your application.
index.php:
<?php
// Set BASE_PATH to one directory up, outside of document root
define('BASE_PATH', realpath(dirname(__FILE__) . '/..'));
// Instantiate new application
$app = new Yaf_Application(BASE_PATH . '/application/config/application.ini');
$app->bootstrap()->run();
?>
Blog.php (controller):
<?php
$app = Yaf_Application::app();
print_r($app);
?>