<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaf-application.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'yaf-application.getappdirectory.php',
    1 => 'Yaf_Application::getAppDirectory',
    2 => 'Get the application directory',
  ),
  'up' => 
  array (
    0 => 'class.yaf-application.php',
    1 => 'Yaf_Application',
  ),
  'prev' => 
  array (
    0 => 'yaf-application.execute.php',
    1 => 'Yaf_Application::execute',
  ),
  'next' => 
  array (
    0 => 'yaf-application.getconfig.php',
    1 => 'Yaf_Application::getConfig',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yaf/yaf_application/getappdirectory.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-application.getappdirectory" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Application::getAppDirectory</h1>
  <p class="verinfo">(Yaf &gt;=2.1.4)</p><p class="refpurpose"><span class="refname">Yaf_Application::getAppDirectory</span> &mdash; <span class="dc-title">Get the application directory</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-application.getappdirectory-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><strong>Yaf_Application::getAppDirectory</strong></span>(): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span></div>

  <p class="simpara">
   Get the application directory, under which Yaf looks for controllers,
   views and modules. It is set by the
   <code class="literal">application.directory</code> configuration entry, or by
   <span class="methodname"><a href="yaf-application.setappdirectory.php" class="methodname">Yaf_Application::setAppDirectory()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-application.getappdirectory-parameters">
  <h3 class="title">Parameters</h3>
  <p class="simpara">This function has no parameters.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaf-application.getappdirectory-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   The absolute path of the application directory, or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> if the
   application is not properly initialized.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-application.getappdirectory-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="methodname"><strong>Yaf_Application::getAppDirectory()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
</span><span style="color: #FF8000">/* conf/application.ini:
   application.directory = APPLICATION_PATH "/application"
*/
</span><span style="color: #0000BB">$app </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Application</span><span style="color: #007700">(
    new </span><span style="color: #0000BB">Yaf_Config_Ini</span><span style="color: #007700">(</span><span style="color: #0000BB">APPLICATION_PATH </span><span style="color: #007700">. </span><span style="color: #DD0000">"/conf/application.ini"</span><span style="color: #007700">, </span><span style="color: #DD0000">"product"</span><span style="color: #007700">)
);

</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$app</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getAppDirectory</span><span style="color: #007700">());
</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">Yaf_Application</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getAppDirectory</span><span style="color: #007700">());
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

   <div class="example-contents"><p>The above example will output
something similar to:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">string(31) &quot;/var/www/html/myapp/application&quot;
string(31) &quot;/var/www/html/myapp/application&quot;</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yaf-application.getappdirectory-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="yaf-application.setappdirectory.php" class="methodname" rel="rdfs-seeAlso">Yaf_Application::setAppDirectory()</a> - Change the application directory</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>