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
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.dojo.view" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Dojo View Helpers</title>
<para>
Zend Framework provides the following Dojo-specific view helpers:
</para>
<itemizedlist>
<listitem>
<para>
<emphasis><methodname>dojo()</methodname>:</emphasis> setup the Dojo environment
for your page, including dojo configuration values, custom module paths, module
require statements, theme stylesheets, <acronym>CDN</acronym> usage, and more.
</para>
</listitem>
</itemizedlist>
<example id="zend.dojo.view.setup">
<title>Using Dojo View Helpers</title>
<para>
To use Dojo view helpers, you will need to tell your view object
where to find them. You can do this by calling
<methodname>addHelperPath()</methodname>:
</para>
<programlisting language="php"><![CDATA[
$view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
]]></programlisting>
<para>
Alternately, you can use <classname>Zend_Dojo</classname>'s
<methodname>enableView()</methodname> method to do the work for you:
</para>
<programlisting language="php"><![CDATA[
Zend_Dojo::enableView($view);
]]></programlisting>
</example>
<xi:include href="Zend_Dojo-View-Dojo.xml" />
<xi:include href="Zend_Dojo-View-Helpers.xml" />
</sect1>
<!--
vim:se ts=4 sw=4 et:
-->
|