<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Get Yaf_Dispatcher instance</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="yaf-application.getconfig.html">Yaf_Application::getConfig</a></div> <div class="next" style="text-align: right; float: right;"><a href="yaf-application.getlasterrormsg.html">Yaf_Application::getLastErrorMsg</a></div> <div class="up"><a href="class.yaf-application.html">Yaf_Application</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="yaf-application.getdispatcher" class="refentry"> <div class="refnamediv"> <h1 class="refname">Yaf_Application::getDispatcher</h1> <p class="verinfo">(Yaf >=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Application::getDispatcher</span> — <span class="dc-title">Get Yaf_Dispatcher instance</span></p> </div> <div class="refsect1 description" id="refsect1-yaf-application.getdispatcher-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type"><a href="class.yaf-dispatcher.html" class="type Yaf_Dispatcher">Yaf_Dispatcher</a></span> <span class="methodname"><strong>Yaf_Application::getDispatcher</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> </p> </div> <div class="refsect1 parameters" id="refsect1-yaf-application.getdispatcher-parameters"> <h3 class="title">Parameters</h3> <p class="para">This function has no parameters.</p> </div> <div class="refsect1 returnvalues" id="refsect1-yaf-application.getdispatcher-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> </p> </div> <div class="refsect1 examples" id="refsect1-yaf-application.getdispatcher-examples"> <h3 class="title">Examples</h3> <div class="example" id="example-4121"> <p><strong>Example #1 <span class="function"><strong>Yaf_Application::getDispatcher()</strong></span>example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$config </span><span style="color: #007700">= array(<br /> </span><span style="color: #DD0000">"application" </span><span style="color: #007700">=> array(<br /> </span><span style="color: #DD0000">"directory" </span><span style="color: #007700">=> </span><span style="color: #0000BB">realpath</span><span style="color: #007700">(</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"/application"</span><span style="color: #007700">,<br /> ),<br />);<br /><br /></span><span style="color: #FF8000">/** Yaf_Application */<br /></span><span style="color: #0000BB">$application </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Application</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$application</span><span style="color: #007700">-></span><span style="color: #0000BB">getDispatcher</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output something similar to:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> Yaf_Dispatcher Object ( [_router:protected] => Yaf_Router Object ( [_routes:protected] => Array ( [_default] => Yaf_Route_Static Object ( ) ) [_current:protected] => ) [_view:protected] => [_request:protected] => Yaf_Request_Http Object ( [module] => [controller] => [action] => [method] => Cli [params:protected] => Array ( ) [language:protected] => [_exception:protected] => [_base_uri:protected] => [uri:protected] => [dispatched:protected] => [routed:protected] => ) [_plugins:protected] => Array ( ) [_auto_render:protected] => 1 [_return_response:protected] => [_instantly_flush:protected] => [_default_module:protected] => Index [_default_controller:protected] => Index [_default_action:protected] => index [_response] => Yaf_Response_Cli Object ( [_header:protected] => Array ( ) [_body:protected] => [_sendheader:protected] => ) ) </pre></div> </div> </div> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="yaf-application.getconfig.html">Yaf_Application::getConfig</a></div> <div class="next" style="text-align: right; float: right;"><a href="yaf-application.getlasterrormsg.html">Yaf_Application::getLastErrorMsg</a></div> <div class="up"><a href="class.yaf-application.html">Yaf_Application</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>