<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect3 id="zend.view.helpers.initial.action">
    <title>Action View Helper</title>

    <para>
        The <code>Action</code> view helper enables view scripts to dispatch a
        given controller action; the result of the response object following the
        dispatch is then returned. These can be used when a particular action
        could generate re-usable content or "widget-ized" content.
    </para>

    <para>
        Actions that result in a <code>_forward()</code> or redirect are
        considered invalid, and will return an empty string.
    </para>

    <para>
        The API for the <code>Action</code> view helper follows that of most MVC
        components that invoke controller actions: <code>action($action,
            $controller, $module = null, array $params = array())</code>.
        <code>$action</code> and <code>$controller</code> are required; if no
        module is specified, the default module is assumed.
    </para>

    <example id="zend.view.helpers.initial.action.usage">
        <title>Basic Usage of Action View Helper</title>

        <para>
            As an example, you may have a <code>CommentController</code> with a
            <code>listAction()</code> method you wish to invoke in order to pull
            a list of comments for the current request:
        </para>

        <programlisting role="php"><![CDATA[
<div id="sidebar right">
    <div class="item">
        <?php echo $this->action('list',
                                 'comment',
                                 null,
                                 array('count' => 10)); ?>
    </div>
</div>
]]></programlisting>
    </example>
</sect3>
<!--
vim:se ts=4 sw=4 et:
-->
