<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect3 id="zend.controller.router.routes.rest">
    <title>Zend_Rest_Route</title>

    <para>
        The <classname>Zend_Rest</classname> component contains a RESTful route
        for <classname>Zend_Controller_Router_Rewrite</classname>. This route
        offers a standardized routing scheme that routes requests by translating
        the <acronym>HTTP</acronym> method and the <acronym>URI</acronym>
        to a module, controller, and action. The table below provides an overview
        of how request methods and <acronym>URI</acronym>'s are routed.
    </para>

    <table frame="all">
        <title>Zend_Rest_Route Behavior</title>

        <tgroup cols='3' align='left' colsep='1' rowsep='1'>
            <colspec colname='method' />
            <colspec colname='URI' />
            <colspec colname='route' />
            <thead>
                <row>
                    <entry>Method</entry>
                    <entry><acronym>URI</acronym></entry>
                    <entry>Module_Controller::action</entry>
                </row>
            </thead>
            <tbody>
                <row>
                    <entry><constant>GET</constant></entry>
                    <entry><filename>/product/ratings/</filename></entry>
                    <entry><methodname>Product_RatingsController::indexAction()</methodname></entry>
                </row>
                <row>
                    <entry><constant>GET</constant></entry>
                    <entry><filename>/product/ratings/:id</filename></entry>
                    <entry><methodname>Product_RatingsController::getAction()</methodname></entry>
                </row>
                <row>
                    <entry><constant>POST</constant></entry>
                    <entry><filename>/product/ratings</filename></entry>
                    <entry><methodname>Product_RatingsController::postAction()</methodname></entry>
                </row>
                <row>
                    <entry><constant>PUT</constant></entry>
                    <entry><filename>/product/ratings/:id</filename></entry>
                    <entry><methodname>Product_RatingsController::putAction()</methodname></entry>
                </row>
                <row>
                    <entry><constant>DELETE</constant></entry>
                    <entry><filename>/product/ratings/:id</filename></entry>
                    <entry>
                        <methodname>Product_RatingsController::deleteAction()</methodname>
                    </entry>
                </row>
                <row>
                    <entry><constant>POST</constant></entry>
                    <entry><command>/product/ratings/:id?_method="PUT"</command></entry>
                    <entry><methodname>Product_RatingsController::putAction()</methodname></entry>
                </row>
                <row>
                    <entry><constant>POST</constant></entry>
                    <entry><command>/product/ratings/:id?_method="DELETE"</command></entry>
                    <entry>
                        <methodname>Product_RatingsController::deleteAction()</methodname>
                    </entry>
                </row>
            </tbody>
        </tgroup>
    </table>

    <para>
        To enable <classname>Zend_Rest_Route</classname> for an entire
        application, construct it with no config params and add it as the
        default route on the front controller:
    </para>

    <programlisting language="php"><![CDATA[
$front     = Zend_Controller_Front::getInstance();
$restRoute = new Zend_Rest_Route($front);
$front->getRouter()->addRoute('default', $restRoute);
]]></programlisting>

    <note>
        <para>
            If <classname>Zend_Rest_Route</classname> cannot match a valid
            module, controller, or action, it will return <constant>FALSE</constant> and the router
            will attempt to match using the next route in the router.
        </para>
    </note><commit_msg>ZF-8133: 2 Routes in Zend_Controller_Router_REST documentation are bold without reason<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect3 id="zend.controller.router.routes.rest">
    <title>Zend_Rest_Route</title>

    <para>
        The <classname>Zend_Rest</classname> component contains a RESTful route
        for <classname>Zend_Controller_Router_Rewrite</classname>. This route
        offers a standardized routing scheme that routes requests by translating
        the <acronym>HTTP</acronym> method and the <acronym>URI</acronym>
        to a module, controller, and action. The table below provides an overview
        of how request methods and <acronym>URI</acronym>'s are routed.
    </para>

    <table frame="all">
        <title>Zend_Rest_Route Behavior</title>

        <tgroup cols='3' align='left' colsep='1' rowsep='1'>
            <colspec colname='method' />
            <colspec colname='URI' />
            <colspec colname='route' />
            <thead>
                <row>
                    <entry>Method</entry>
                    <entry><acronym>URI</acronym></entry>
                    <entry>Module_Controller::action</entry>
                </row>
            </thead>
            <tbody>
                <row>
                    <entry><constant>GET</constant></entry>
                    <entry><filename>/product/ratings/</filename></entry>
                    <entry><methodname>Product_RatingsController::indexAction()</methodname></entry>
                </row>
                <row>
                    <entry><constant>GET</constant></entry>
                    <entry><filename>/product/ratings/:id</filename></entry>
                    <entry><methodname>Product_RatingsController::getAction()</methodname></entry>
                </row>
                <row>
                    <entry><constant>POST</constant></entry>
                    <entry><filename>/product/ratings</filename></entry>
                    <entry><methodname>Product_RatingsController::postAction()</methodname></entry>
                </row>
                <row>
                    <entry><constant>PUT</constant></entry>
                    <entry><filename>/product/ratings/:id</filename></entry>
                    <entry><methodname>Product_RatingsController::putAction()</methodname></entry>
                </row>
                <row>
                    <entry><constant>DELETE</constant></entry>
                    <entry><filename>/product/ratings/:id</filename></entry>
                    <entry>
                        <methodname>Product_RatingsController::deleteAction()</methodname>
                    </entry>
                </row>
                <row>
                    <entry><constant>POST</constant></entry>
                    <entry><filename>/product/ratings/:id?_method="PUT"</filename></entry>
                    <entry><methodname>Product_RatingsController::putAction()</methodname></entry>
                </row>
                <row>
                    <entry><constant>POST</constant></entry>
                    <entry><filename>/product/ratings/:id?_method="DELETE"</filename></entry>
                    <entry>
                        <methodname>Product_RatingsController::deleteAction()</methodname>
                    </entry>
                </row>
            </tbody>
        </tgroup>
    </table>

    <para>
        To enable <classname>Zend_Rest_Route</classname> for an entire
        application, construct it with no config params and add it as the
        default route on the front controller:
    </para>

    <programlisting language="php"><![CDATA[
$front     = Zend_Controller_Front::getInstance();
$restRoute = new Zend_Rest_Route($front);
$front->getRouter()->addRoute('default', $restRoute);
]]></programlisting>

    <note>
        <para>
            If <classname>Zend_Rest_Route</classname> cannot match a valid
            module, controller, or action, it will return <constant>FALSE</constant> and the router
            will attempt to match using the next route in the router.
        </para>
    </note>
{'fraction_non_alphanumeric': 0.13255217868912486, 'fraction_numerical': 0.002319052849993897, 'mean_word_length': 1.8862275449101797, 'pattern_counts': {'":': 0, '<': 309, '<?xml version=': 2, '>': 313, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6649537', 'n_tokens_mistral': 2192, 'n_tokens_neox': 2038, 'n_words': 390}