00001 <?php
00026 require_once 'Zend/View/Helper/HtmlElement.php';
00027
00035 class Zend_View_Helper_HtmlObject extends Zend_View_Helper_HtmlElement
00036 {
00047 public function htmlObject($data, $type, array $attribs = array(), array $params = array(), $content = null)
00048 {
00049
00050 $attribs = array_merge(array('data' => $data,
00051 'type' => $type), $attribs);
00052
00053
00054 $paramHtml = array();
00055 $closingBracket = $this->getClosingBracket();
00056
00057 foreach ($params as $param => $options) {
00058 if (is_string($options)) {
00059 $options = array('value' => $options);
00060 }
00061
00062 $options = array_merge(array('name' => $param), $options);
00063
00064 $paramHtml[] = '<param' . $this->_htmlAttribs($options) . $closingBracket;
00065 }
00066
00067
00068 if (is_array($content)) {
00069 $content = implode(self::EOL, $content);
00070 }
00071
00072
00073 $xhtml = '<object' . $this->_htmlAttribs($attribs) . '>' . self::EOL
00074 . implode(self::EOL, $paramHtml) . self::EOL
00075 . ($content ? $content . self::EOL : '')
00076 . '</object>';
00077
00078 return $xhtml;
00079 }
00080 }