<?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-static.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'es',
  ),
  'this' => 
  array (
    0 => 'yaf-route-static.route.php',
    1 => 'Yaf_Route_Static::route',
    2 => 'Enviar una petici&oacute;n',
  ),
  'up' => 
  array (
    0 => 'class.yaf-route-static.php',
    1 => 'Yaf_Route_Static',
  ),
  'prev' => 
  array (
    0 => 'yaf-route-static.match.php',
    1 => 'Yaf_Route_Static::match',
  ),
  'next' => 
  array (
    0 => 'class.yaf-route-supervar.php',
    1 => 'Yaf_Route_Supervar',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/yaf/yaf_route_static/route.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-route-static.route" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Route_Static::route</h1>
  <p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Route_Static::route</span> &mdash; <span class="dc-title">Enviar una petición</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-route-static.route-description">
  <h3 class="title">Descripción</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><strong>Yaf_Route_Static::route</strong></span>(<span class="methodparam"><span class="type"><a href="class.yaf-request-abstract.php" class="type Yaf_Request_Abstract">Yaf_Request_Abstract</a></span> <code class="parameter">$request</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   Enruta la petición según el URI de estilo PATH_INFO: el primer segmento de
   ruta se trata como nombre de módulo solo si es uno de los módulos
   registrados; en caso contrario, los segmentos se asocian por orden al
   controlador y a la acción. Los segmentos restantes se convierten en
   argumentos de la petición.
  </p>
  <p class="simpara">
   Por ejemplo, sin ningún módulo llamado <code class="literal">foo</code>,
   <code class="literal">/foo/bar/age/10</code> enruta al controlador
   <code class="literal">Foo</code> y a la acción <code class="literal">bar</code>, con un
   argumento <code class="literal">age</code> de valor <code class="literal">10</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-route-static.route-parameters">
  <h3 class="title">Parámetros</h3>
  <dl>
   
    <dt><code class="parameter">request</code></dt>
    <dd>
     <p class="simpara">
      La instancia de <span class="classname"><a href="class.yaf-request-abstract.php" class="classname">Yaf_Request_Abstract</a></span> a enrutar.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaf-route-static.route-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="simpara">Siempre devuelve <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.</p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-route-static.route-examples">
  <h3 class="title">Ejemplos</h3>
  <div class="example" id="example-1">
   <p><strong>Ejemplo #1 Ejemplo de <span class="methodname"><strong>Yaf_Route_Static::route()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
$request </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Request_Http</span><span style="color: #007700">(</span><span style="color: #DD0000">"/product/detail/id/10"</span><span style="color: #007700">);

</span><span style="color: #FF8000">/* la ruta estática es la ruta por omisión de Yaf_Router,
 * registrada con el nombre "_default" */
</span><span style="color: #0000BB">$route </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">getRoute</span><span style="color: #007700">(</span><span style="color: #DD0000">"_default"</span><span style="color: #007700">);
</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$route</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">route</span><span style="color: #007700">(</span><span style="color: #0000BB">$request</span><span style="color: #007700">));

</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getControllerName</span><span style="color: #007700">());
</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getActionName</span><span style="color: #007700">());
</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getParam</span><span style="color: #007700">(</span><span style="color: #DD0000">"id"</span><span style="color: #007700">));
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

   <div class="example-contents"><p>Resultado del ejemplo anterior
es similar a:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">bool(true)
string(7) &quot;product&quot;
string(6) &quot;detail&quot;
string(2) &quot;10&quot;</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yaf-route-static.route-seealso">
  <h3 class="title">Véase también</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="yaf-route-static.match.php" class="methodname" rel="rdfs-seeAlso">Yaf_Route_Static::match()</a> - El prop&oacute;sito de match</span></li>
   <li><span class="methodname"><a href="yaf-route-static.assemble.php" class="methodname" rel="rdfs-seeAlso">Yaf_Route_Static::assemble()</a> - Ensamblar un URL</span></li>
  </ul>
 </div>


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