<sect3 id="zend.controller.router.routes.static">
    <title>Zend_Controller_Router_Route_Static</title>

    <para>
        The examples above all use dynamic routes -- routes that contain
        patterns to match against. Sometimes, however, a particular route is
        set in stone, and firing up the regular expression engine would be
        an overkill. The answer to this situation is to use static routes:
    </para>

    <programlisting role="php"><![CDATA[
$route = new Zend_Controller_Router_Route_Static(
    'login',
    array('controller' => 'auth', 'action' => 'login')
);
$router->addRoute('login', $route);
]]>
    </programlisting>

    <para>
        Above route will match a URL of <code>http://domain.com/login</code>,
        and dispatch to <code>AuthController::loginAction()</code>.
    </para>

</sect3>
<!--
vim:se ts=4 sw=4 et:
-->

<sect3 id="zend.controller.router.routes.static">
    <title>Zend_Controller_Router_Route_Static</title>

    <para>
        The examples above all use dynamic routes -- routes that contain
        patterns to match against. Sometimes, however, a particular route is
        set in stone, and firing up the regular expression engine would be
        an overkill. The answer to this situation is to use static routes:
    </para>

    <programlisting role="php"><![CDATA[
$route = new Zend_Controller_Router_Route_Static(
    'login',
    array('controller' => 'auth', 'action' => 'login')
);
$router->addRoute('login', $route);
]]>
    </programlisting>

    <para>
        Above route will match a URL of <code>http://domain.com/login</code>,
        and dispatch to <code>AuthController::loginAction()</code>.
    </para>

    <note id="zend.controller.router.routes.static.warning">
        <title>Warning: Static routes must contain sane defaults</title>

        <para>
            Since a static route does not pass any part of the URL to the
            request object as parameters, you <emphasis>must</emphasis> pass
            all parameters necessary for dispatching a request as defaults to
            the route. Omitting the "controller" or "action" default values will
            have unexpected results, and will likely result in the request being
            undispatchable.
        </para>

        <para>
            As a rule of thumb, always provide each of the following default
            values:
        </para>

        <itemizedlist>
            <listitem><para>controller</para></listitem>
            <listitem><para>action</para></listitem>
            <listitem><para>module (if not default)</para></listitem>
        </itemizedlist>

        <para>
            Optionally, you can also pass the "useDefaultControllerAlways"
            parameter to the front controller during bootstrapping:
        </para>

        <programlisting role="php"><![CDATA[
$front->setParam('useDefaultControllerAlways', true);
]]></programlisting>

        <para>
            However, this is considered a workaround; it is always better to
            explicitly define sane defaults.
        </para>
    </note>
</sect3>
<!--
vim:se ts=4 sw=4 et:
-->

Add note to Static Route documentation regarding necessity of sane defaults
ZF-5140: Add note to Static Route documentation regarding necessity of sane defaults
