File: Zend_View-Helpers-Action.xml

package info (click to toggle)
zendframework 1.12.9%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 133,584 kB
  • sloc: xml: 1,311,829; php: 570,173; sh: 170; makefile: 125; sql: 121
file content (49 lines) | stat: -rw-r--r-- 1,867 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect3 id="zend.view.helpers.initial.action">
    <title>Action View Helper</title>

    <para>
        The <classname>Action</classname> 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 <methodname>_forward()</methodname> or redirect are
        considered invalid, and will return an empty string.
    </para>

    <para>
        The <acronym>API</acronym> for the <classname>Action</classname> view helper follows that of
        most <acronym>MVC</acronym> components that invoke controller actions:
        <command>action($action, $controller, $module = null, array $params = array())</command>.
        <varname>$action</varname> and <varname>$controller</varname> 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 <classname>CommentController</classname> with a
            <methodname>listAction()</methodname> method you wish to invoke in order to pull
            a list of comments for the current request:
        </para>

        <programlisting language="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:
-->