| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?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:
- -->
|