<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaf-dispatcher.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'yaf-dispatcher.setdefaultmodule.php',
    1 => 'Yaf_Dispatcher::setDefaultModule',
    2 => 'Change default module name',
  ),
  'up' => 
  array (
    0 => 'class.yaf-dispatcher.php',
    1 => 'Yaf_Dispatcher',
  ),
  'prev' => 
  array (
    0 => 'yaf-dispatcher.setdefaultcontroller.php',
    1 => 'Yaf_Dispatcher::setDefaultController',
  ),
  'next' => 
  array (
    0 => 'yaf-dispatcher.seterrorhandler.php',
    1 => 'Yaf_Dispatcher::setErrorHandler',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yaf/yaf_dispatcher/setdefaultmodule.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-dispatcher.setdefaultmodule" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Dispatcher::setDefaultModule</h1>
  <p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Dispatcher::setDefaultModule</span> &mdash; <span class="dc-title">Change default module name</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-dispatcher.setdefaultmodule-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_Dispatcher::setDefaultModule</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$module</code></span>): <span class="type"><span class="type"><a href="class.yaf-dispatcher.php" class="type Yaf_Dispatcher">Yaf_Dispatcher</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   Change the module name which is used when a module name can not be
   extracted from the request URI. The module must be a registered one,
   see <span class="methodname"><a href="yaf-application.getmodules.php" class="methodname">Yaf_Application::getModules()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-dispatcher.setdefaultmodule-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">module</code></dt>
    <dd>
     <p class="simpara">
      The name of a registered module.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaf-dispatcher.setdefaultmodule-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns the <span class="classname"><a href="class.yaf-dispatcher.php" class="classname">Yaf_Dispatcher</a></span> object itself on
   success, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if the given module is not registered (and a
   <strong><code><a href="yaf.constants.php#constant.yaf-err-type-error">YAF_ERR_TYPE_ERROR</a></code></strong> is triggered) or if the
   application is not initialized, or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> otherwise.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-yaf-dispatcher.setdefaultmodule-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="simpara">
   Triggers a <strong><code><a href="yaf.constants.php#constant.yaf-err-type-error">YAF_ERR_TYPE_ERROR</a></code></strong> error if
   <code class="parameter">module</code> is not a registered module name.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-dispatcher.setdefaultmodule-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="methodname"><strong>Yaf_Dispatcher::setDefaultModule()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
$app </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Application</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">"/conf/application.ini"</span><span style="color: #007700">);

</span><span style="color: #FF8000">// "Home" must be a registered module, e.g. via
// application.modules = "Index,Home,Admin" in conf/application.ini
</span><span style="color: #0000BB">Yaf_Dispatcher</span><span style="color: #007700">::</span><span style="color: #0000BB">getInstance</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">setDefaultModule</span><span style="color: #007700">(</span><span style="color: #DD0000">"Home"</span><span style="color: #007700">);

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

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yaf-dispatcher.setdefaultmodule-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="yaf-dispatcher.setdefaultcontroller.php" class="methodname" rel="rdfs-seeAlso">Yaf_Dispatcher::setDefaultController()</a> - Change default controller name</span></li>
    <li><span class="methodname"><a href="yaf-dispatcher.setdefaultaction.php" class="methodname" rel="rdfs-seeAlso">Yaf_Dispatcher::setDefaultAction()</a> - Change default action name</span></li>
    <li><span class="methodname"><a href="yaf-dispatcher.getdefaultmodule.php" class="methodname" rel="rdfs-seeAlso">Yaf_Dispatcher::getDefaultModule()</a> - Retrieve the default module name</span></li>
   </ul>
  </p>
 </div>


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