The Yaf_Application instance, or null if no
application has been initialized yet.
Examples
Example #1 Yaf_Application::app() example
<?php
/* index.php, the application entry */
$config = new Yaf_Config_Ini(__DIR__ . "/conf/application.ini", "product");
$application = new Yaf_Application($config);
$application->bootstrap()->run();
?>
Example #2 Retrieving the application instance elsewhere
<?php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
/* Yaf_Application::app() is an alias of getInstance() */
$app = Yaf_Application::app();
var_dump($app->environ());
var_dump(Yaf_Application::getInstance() === $app);
return false;
}
}
?>
The above example will output
something similar to: