"html"이라는 맞춤 요소를 만들었습니다.
/**
* Abstract class for extension
*/
require_once 'Zend/View/Helper/FormElement.php';
/**
* Helper to show HTML
*
*/
class Zend_View_Helper_FormHtml extends Zend_View_Helper_FormElement
{
/**
* Helper to show a html in a form
*
* @param string|array $name If a string, the element name. If an
* array, all other parameters are ignored, and the array elements
* are extracted in place of added parameters.
*
* @param mixed $value The element value.
*
* @param array $attribs Attributes for the element tag.
*
* @return string The element XHTML.
*/
public function formHtml($name, $value = null, $attribs = null)
{
$info = $this->_getInfo($name, $value, $attribs);
extract($info); // name, value, attribs, options, listsep, disable
// Render the button.
$xhtml = 'view->escape($id) . '">'
. $this->_htmlAttribs($attribs)
. $this->view->escape($value) . '';
return $xhtml;
}
}
당신은 할 수 있습니다 내가보기 도우미 FormHtml.php를 추가했다
/** Zend_Form_Element_Xhtml */
require_once 'Zend/Form/Element/Xhtml.php';
/**
* HTML form element
*
*/
class Zend_Form_Element_Html extends Zend_Form_Element_Xhtml
{
/**
* Default form view helper to use for rendering
* @var string
*/
public $helper = 'formHtml';
}
두 번째는 (내가/뷰/도우미 응용 프로그램에 넣어) : 나는에/양식/요소 Html.php 추가 다음과 같이 양식에 html을 추가하십시오.
$form->createElement('html', 'someid', array('value'=>'gnafoobar
'));
더 많은 단순화가 가능할 수 있습니다.
출처
2009-10-10 14:45:19
2ni
답변 해 주셔서 감사합니다. 그것은 나를 도왔다. – NAVEED