File: Zend_Controller-ActionHelpers-ActionStack.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 (91 lines) | stat: -rw-r--r-- 3,624 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?xml version="1.0" encoding="UTF-8"?>
<!-- EN-Revision: 24249 -->
<!-- Reviewed: no -->
<sect3 id="zend.controller.actionhelpers.actionstack">
    <title>ActionStack</title>

    <para>
        Der <emphasis>ActionStack</emphasis> Helfer erlaubt das Verschieben von Anfragen zum <link
            linkend="zend.controller.plugins.standard.actionstack">ActionStack</link> Front
        Controller Plugin, welches effektiv hilft um eine Queue von Aktionen zu erstellen die wärend
        der Anfrage ausgeführt wird. Der Helfer erlaubt das hinzufügen von Aktionen entweder durch
        Spezifikation von neuen Anfrage Objekten oder Aktion - Controller - Modul Sets.
    </para>

    <note>
        <title>Der Aufruf des ActionStack Helpers inizialisiert das ActionStack Plugin</title>

        <para>
            Der Aufruf des <emphasis>ActionStack</emphasis> Helpers registriert das
            <emphasis>ActionStack</emphasis> Plugin implizit -- was bedeutet dass das
            <emphasis>ActionStack</emphasis> Plugin nicht explizit registriert werden muß um dessen
            Funktionalität zu verwenden.
        </para>
    </note>

    <example id="zend.controller.actionhelpers.actionstack.simple">
        <title>
            Eine Aufgabe hinzufügen indem Aktion, Controller und Modulnamen verwendet werden
        </title>

        <para>
            Oft ist es am einfachsten, einfach die Aktion, den Controller und das Modul (und
            optionale Anfrage Parameter) zu spezifizieren, wie wenn
            <methodname>Zend_Controller_Action::_forward()</methodname> aufgerufen werden würde:
        </para>

        <programlisting language="php"><![CDATA[
class FooController extends Zend_Controller_Action
{
    public function barAction()
    {
        // Dem Stack zwei Aktionen hinzufügen
        // Und /foo/baz/bar/baz aufrufen
        // (FooController::bazAction() mit der Anfrage var bar == baz)
        $this->_helper->actionStack('baz',
                                    'foo',
                                    'default',
                                    array('bar' => 'baz'));

        // Aufruf für /bar/bat hinzufügen
        // (BarController::batAction())
        $this->_helper->actionStack('bat', 'bar');
    }
}
]]></programlisting>
    </example>

    <example id="zend.controller.actionhelpers.actionstack.simple2">
        <title>Eine Aufgabe hinzufügen durch Verwendung eines Anfrage Objektes</title>

        <para>
            Machmal macht die <acronym>OOP</acronym> Natur eines Anfrage Objektes mehr Sinn; solch
            ein Objekt kann dem <emphasis>ActionStack</emphasis> Helfer genauso übergeben werden.
        </para>

        <programlisting language="php"><![CDATA[
class FooController extends Zend_Controller_Action
{
    public function barAction()
    {
        // Dem Stack zwei Aktionen hinzufügen
        // Aufruf zu /foo/baz/bar/baz hinzufügen
        // (FooController::bazAction() mit der Anfrage var bar == baz)
        $request = clone $this->getRequest();
        // Controller oder Modul nicht setzen, verwende aktuelle Werte
        $request->setActionName('baz')
                ->setParams(array('bar' => 'baz'));
        $this->_helper->actionStack($request);

        // Aufruf zu /bar/bat hinzufügen
        // (BarController::batAction())
        $request = clone $this->getRequest();
        // Modul nicht setzen, verwende aktuelle Werte
        $request->setActionName('bat')
                ->setControllerName('bar');
        $this->_helper->actionStack($request);
    }
}
]]></programlisting>
    </example>
</sect3>