Browse Source

Merge r25226 to 1.12 release branch

git-svn-id: http://framework.zend.com/svn/framework/standard/branches/release-1.12@25227 44c647ce-9c0f-0410-b52a-842ac1e357ba
frosch 13 years ago
parent
commit
fca6e98bb9

+ 5 - 0
documentation/manual/en/manual.xml.in

@@ -2401,6 +2401,11 @@
 
     <appendix id="migration">
         <title>&appendix.migration.title;</title>
+        <xi:include href="ref/migration-112.xml">
+            <xi:fallback>
+                <xi:include href="../en/ref/migration-112.xml" />
+            </xi:fallback>
+        </xi:include>
         <xi:include href="ref/migration-110.xml">
             <xi:fallback>
                 <xi:include href="../en/ref/migration-110.xml" />

+ 93 - 0
documentation/manual/en/ref/migration-112.xml

@@ -0,0 +1,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:
+-->