Browse Source

ZF-5513: Documentation: Add missing view helpers to Zend_View-Helpers.xml

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24872 44c647ce-9c0f-0410-b52a-842ac1e357ba
adamlundrigan 13 years ago
parent
commit
421827ba1e

+ 42 - 0
documentation/manual/en/module_specs/Zend_View-Helpers-RenderToPlaceholder.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Reviewed: no -->
+<sect3 id="zend.view.helpers.initial.rendertoplaceholder">
+    <title>RenderToPlaceholder Helper</title>
+
+    <para>
+        Renders a template (view script) and stores the rendered output as a
+        placeholder variable for later use.
+    </para>
+
+    <note role="info">
+        <para>
+            The helper uses the <link linkend="zend.view.helpers.initial.placeholder">Placeholder helper</link>
+            and his <link linkend="zend.view.helpers.initial.placeholder.capture">Capture methods</link>.
+        </para>
+    </note>
+
+    <example id="zend.view.helpers.initial.rendertoplaceholder.usage">
+        <title>Basic Usage of RenderToPlaceholder</title>
+
+<programlisting language="php"><![CDATA[
+<?php
+// View script (backlink.phtml):
+echo sprintf(
+    '<p class="older"><a href="%s">Older posts</a></p>',
+    $this->url(array('controller' => 'index', 'action' => 'index'))
+)
+?>
+
+<?php
+// Usage:
+$this->renderToPlaceholder('backlink.phtml', 'link');
+?>
+
+<?php
+echo $this->placeholder('link');
+// Output: <p class="older"><a href="index/index">Older posts</a></p>
+?>
+]]></programlisting>
+    </example>
+
+</sect3>

+ 64 - 0
documentation/manual/en/module_specs/Zend_View-Helpers.xml

@@ -242,6 +242,25 @@ echo $this->formCheckbox('foo',
 
             <listitem>
                 <para>
+                    <methodname>formImage($name, $value, $attribs)</methodname>: Creates an
+                    &lt;input type="image" /&gt; element.
+                </para>
+
+<programlisting language="php"><![CDATA[
+echo $this->formImage(
+    'foo',
+    'bar',
+    array(
+        'src' => 'images/button.png',
+        'alt' => 'Button',
+    )
+);
+// Output: <input type="image" name="foo" id="foo" src="images/button.png" value="bar" alt="Button" />
+]]></programlisting>
+            </listitem>
+
+            <listitem>
+                <para>
                     <methodname>formLabel($name, $value, $attribs)</methodname>: Creates a
                     &lt;label&gt; element, setting the <property>for</property> attribute to
                     <varname>$name</varname>, and the actual label text to
@@ -336,6 +355,19 @@ Output:
 
             <listitem>
                 <para>
+                    <methodname>formNote($name, $value = null)</methodname>: Creates a
+                    simple text note. (e.g. as element for headlines in a
+                    <classname>Zend_Form</classname> object)
+                </para>
+
+<programlisting language="php"><![CDATA[
+echo $this->formNote(null, 'This is an example text.');
+// Output: This is an example text.
+]]></programlisting>
+            </listitem>
+
+            <listitem>
+                <para>
                     <methodname>formPassword($name, $value, $attribs)</methodname>: Creates an
                     &lt;input type="password" /&gt; element.
                 </para>
@@ -601,6 +633,37 @@ echo $this->url(
 
             <listitem>
                 <para>
+                    <methodname>serverUrl($requestUri = null)</methodname>: Helper
+                    for returning the current server URL (optionally with request URI).
+                </para>
+
+<programlisting language="php"><![CDATA[
+// Current server URL in the example is: http://www.example.com/foo.html
+
+echo $this->serverUrl();
+// Output: http://www.example.com
+
+echo $this->serverUrl(true);
+// Output: http://www.example.com/foo.html
+
+echo $this->serverUrl('/foo/bar');
+// Output: http://www.example.com/foo/bar
+
+echo $this->serverUrl()->getHost();
+// Output: www.example.com
+
+echo $this->serverUrl()->getScheme();
+// Output: http
+
+$this->serverUrl()->setHost('www.foo.com');
+$this->serverUrl()->setScheme('https');
+echo $this->serverUrl();
+// Output: https://www.foo.com
+]]></programlisting>
+            </listitem>
+
+            <listitem>
+                <para>
                     <methodname>htmlList($items, $ordered, $attribs, $escape)</methodname>:
                     generates unordered and ordered lists based on the <varname>$items</varname>
                     passed to it. If <varname>$items</varname> is a multidimensional
@@ -676,6 +739,7 @@ echo $this->url(
         <xi:include href="Zend_View-Helpers-HeadTitle.xml" />
         <xi:include href="Zend_View-Helpers-HtmlObject.xml" />
         <xi:include href="Zend_View-Helpers-InlineScript.xml" />
+        <xi:include href="Zend_View-Helpers-RenderToPlaceholder.xml" />
         <xi:include href="Zend_View-Helpers-Json.xml" />
         <xi:include href="Zend_View-Helpers-Navigation.xml" />
         <xi:include href="Zend_View-Helpers-TinySrc.xml" />