<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaf-route-map.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'yaf-route-map.construct.php',
    1 => 'Yaf_Route_Map::__construct',
    2 => 'Construct a map route',
  ),
  'up' => 
  array (
    0 => 'class.yaf-route-map.php',
    1 => 'Yaf_Route_Map',
  ),
  'prev' => 
  array (
    0 => 'yaf-route-map.assemble.php',
    1 => 'Yaf_Route_Map::assemble',
  ),
  'next' => 
  array (
    0 => 'yaf-route-map.route.php',
    1 => 'Yaf_Route_Map::route',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yaf/yaf_route_map/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-route-map.construct" class="refentry">
 <div class="refnamediv">
<h1 class="refname">Yaf_Route_Map::__construct</h1>
<p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Route_Map::__construct</span> &mdash; <span class="dc-title">Construct a map route</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-route-map.construct-description">
  <h3 class="title">Опис</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span><span class="modifier">function</span> <span class="methodname"><strong>Yaf_Route_Map::__construct</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$controller_prefer</code><span class="initializer"> = false</span></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$delimiter</code><span class="initializer"> = &#039;&#039;</span></span>)</div>

  <p class="simpara">Construct a map route. A map route maps the whole URI to a controller name or an action name.</p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-route-map.construct-parameters">
  <h3 class="title">Параметри</h3>
  <dl>
   
    <dt><code class="parameter">controller_prefer</code></dt>
    <dd>
<p class="simpara">Whether to map the URI to a controller name. If <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, the URI is mapped to an action name.</p>
    </dd>
   
   
    <dt><code class="parameter">delimiter</code></dt>
    <dd>
<p class="simpara">The delimiter used to separate the mapped name from the request parameters in the URI. If it occurs as a path segment preceded by a slash, everything after it is parsed as request parameters instead of being part of the mapped name. If empty, no such splitting happens during routing.</p>
    </dd>
   
  </dl>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-yaf-route-map.construct-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
<p class="simpara">No value is returned.</p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-route-map.construct-examples">
  <h3 class="title">Приклади</h3>
  <div class="example" id="example-1">
   <p><strong>Приклад #1 <span class="classname"><a href="class.yaf-route-map.php" class="classname">Yaf_Route_Map</a></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">/**
 * Add a map route to the Yaf_Router route stack
 */
</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">getRouter</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">addRoute</span><span style="color: #007700">(</span><span style="color: #DD0000">"name"</span><span style="color: #007700">,
    new </span><span style="color: #0000BB">Yaf_Route_Map</span><span style="color: #007700">());
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

   <div class="example-contents"><p>Поданий вище приклад виведе щось
схоже на:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">/* for http://yourdomain.com/product/foo/bar
 * the request will carry the following values:
 */
array(
  &quot;action&quot; =&gt; &quot;product_foo_bar&quot;,
)</pre>
</div>
   </div>
  </div>
  <div class="example" id="example-2">
   <p><strong>Приклад #2 <span class="classname"><a href="class.yaf-route-map.php" class="classname">Yaf_Route_Map</a></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">/**
 * Add a map route with a delimiter to the Yaf_Router route stack
 */
</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">getRouter</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">addRoute</span><span style="color: #007700">(</span><span style="color: #DD0000">"name"</span><span style="color: #007700">,
    new </span><span style="color: #0000BB">Yaf_Route_Map</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">, </span><span style="color: #DD0000">"_"</span><span style="color: #007700">));
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

   <div class="example-contents"><p>Поданий вище приклад виведе щось
схоже на:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">/* for http://yourdomain.com/user/list/_/foo/22
 * the request will carry the following values:
 */
array(
    &quot;controller&quot; =&gt; &quot;User_List&quot;,
)

/**
 * and request parameters:
 */
array(
  &quot;foo&quot; =&gt; &quot;22&quot;,
)</pre>
</div>
   </div>
  </div>
  <div class="example" id="example-3">
   <p><strong>Приклад #3 <span class="classname"><a href="class.yaf-route-map.php" class="classname">Yaf_Route_Map</a></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">/**
 * Add a map route to the route stack by calling addConfig
 */
</span><span style="color: #0000BB">$config </span><span style="color: #007700">= array(
    </span><span style="color: #DD0000">"name" </span><span style="color: #007700">=&gt; array(
       </span><span style="color: #DD0000">"type"             </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"map"</span><span style="color: #007700">, </span><span style="color: #FF8000">// Yaf_Route_Map route
       </span><span style="color: #DD0000">"controllerPrefer" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">,
       </span><span style="color: #DD0000">"delimiter"        </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"#!"</span><span style="color: #007700">,
    ),
);
</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">getRouter</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">addConfig</span><span style="color: #007700">(
    new </span><span style="color: #0000BB">Yaf_Config_Simple</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</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-route-map.construct-seealso">
  <h3 class="title">Прогляньте також</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="yaf-route-map.route.php" class="methodname" rel="rdfs-seeAlso">Yaf_Route_Map::route()</a> - Route a request</span></li>
   <li><span class="methodname"><a href="yaf-route-map.assemble.php" class="methodname" rel="rdfs-seeAlso">Yaf_Route_Map::assemble()</a> - Assemble a url</span></li>
  </ul>
 </div>

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