1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect3 id="zend.view.helpers.initial.object">
4 <title>HTML Object Helpers</title>
7 The <acronym>HTML</acronym> <emphasis><![CDATA[
8 <object>]]></emphasis> element is used for embedding
9 media like Flash or QuickTime in web pages. The object view helpers take
10 care of embedding media with minimum effort.
14 There are four initial Object helpers:
20 <methodname>htmlFlash()</methodname>
21 Generates markup for embedding Flash files.
27 <methodname>htmlObject()</methodname>
28 Generates markup for embedding a custom Object.
34 <methodname>htmlPage()</methodname>
35 Generates markup for embedding other (X)HTML pages.
41 <methodname>htmlQuicktime()</methodname>
42 Generates markup for embedding QuickTime files.
48 All of these helpers share a similar interface. For this reason, this
49 documentation will only contain examples of two of these helpers.
52 <example id="zend.view.helpers.initial.object.flash">
53 <title>Flash helper</title>
56 Embedding Flash in your page using the helper is pretty straight-forward.
57 The only required argument is the resource <acronym>URI</acronym>.
60 <programlisting language="php"><![CDATA[
61 <?php echo $this->htmlFlash('/path/to/flash.swf'); ?>
65 This outputs the following <acronym>HTML</acronym>:
68 <programlisting language="html"><![CDATA[
69 <object data="/path/to/flash.swf"
70 type="application/x-shockwave-flash"
71 classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
72 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
78 Additionally you can specify attributes, parameters and content that can
79 be rendered along with the <emphasis><![CDATA[
80 <object>]]></emphasis>. This will
81 be demonstrated using the <methodname>htmlObject()</methodname> helper.
84 <example id="zend.view.helpers.initial.object.object">
85 <title>Customizing the object by passing additional arguments</title>
88 The first argument in the object helpers is always required. It is
89 the <acronym>URI</acronym> to the resource you want to embed. The second argument is
90 only required in the <methodname>htmlObject()</methodname> helper. The other helpers
91 already contain the correct value for this argument. The third
92 argument is used for passing along attributes to the object element.
93 It only accepts an array with key-value pairs. <property>classid</property>
94 and <property>codebase</property> are examples of such attributes. The fourth
95 argument also only takes a key-value array and uses them to create
97 <param>]]></emphasis> elements. You will see an example
98 of this shortly. Lastly, there is the option of providing additional
99 content to the object. Now for an example which utilizes all arguments.
102 <programlisting language="php"><![CDATA[
103 echo $this->htmlObject(
120 <object data="/path/to/file.ext" type="mime/type"
121 attr1="aval1" attr2="aval2">
122 <param name="param1" value="pval1" />
123 <param name="param2" value="pval2" />