Yaf_Dispatcher
在线手册:中文 英文
PHP手册

Yaf_Dispatcher::getApplication

(PECL yaf >=1.0.0)

Yaf_Dispatcher::getApplicationRetrive the application

说明

public Yaf_Application Yaf_Dispatcher::getApplication ( void )

Retrive the Yaf_Application instance. same as Yaf_Application::app().

Warning

本函数还未编写文档,仅有参数列表。

参数

此函数没有参数。

返回值

参见


Yaf_Dispatcher
在线手册:中文 英文
PHP手册
PHP手册 - N: Retrive the application

用户评论:

brandon at brandonlamb dot com (30-Dec-2011 04:38)

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);
?>