File: migration-112.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 (93 lines) | stat: -rw-r--r-- 2,454 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
92
93
<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="migration.112">
    <title>Zend Framework 1.12</title>

    <para>
        When upgrading from a previous release to Zend Framework 1.12 or higher you
        should note the following migration notes.
    </para>

    <sect2 id="migration.12.zend.view.helper.navigation">
        <title>Zend_View_Helper_Navigation</title>

        <para>
            Prior to the 1.12 release, a helper with the name
            "My_View_Helper_Navigation_Menu" can not be used, because the proxy
            helper returns always the standard view helper
            "Zend_View_Helper_Navigation_Menu".
        </para>

        <para>
            Starting from version 1.12, you can use our own navigation helpers
            with the name "menu", "breadcrumbs", ...
        </para>

        <para>
            Create your own helper with name "Menu":
        </para>

        <programlisting language="php"><![CDATA[
class My_View_Helper_Navigation_Menu
    extends Zend_View_Helper_Navigation_HelperAbstract
{
    public function menu(Zend_Navigation_Container $container = null)
    {
        if (null !== $container) {
            $this->setContainer($container);
        }

        return $this;
    }

    public function render(Zend_Navigation_Container $container = null)
    {
        return '<nav>Example</nav>';
    }
}
]]></programlisting>

        <para>
            Add the helper path to <classname>Zend_View</classname> in your
            Bootstrap class:
        </para>

        <programlisting language="php"><![CDATA[
    protected function _initView()
    {
        $this->bootstrap('view');
        $this->view->addHelperPath(
            'path/to/helper',
            'My_View_Helper_Navigation'
        );
    }
]]></programlisting>

        <para>
            Or add the helper path in your "application.ini" file:
        </para>

        <programlisting language="ini"><![CDATA[
resources.view.helperPath.My_View_Helper_Navigation = "path/to/helper"
]]></programlisting>

        <para>
            The following code is used in a view script:
        </para>

        <programlisting language="php"><![CDATA[
<?php echo $this->navigation()->menu(); ?>
]]></programlisting>

        <para>
            Output:
        </para>

        <programlisting language="html"><![CDATA[
<nav>Example</nav>
]]></programlisting>
    </sect2>
</sect1>
<!--
vim:se ts=4 sw=4 et:
-->