|
|||
|
Hi,
is this a bug? simple, a description is not added to form. e.g. $form = new Zend_Form(); $form->setDescription('I am the form description'); ...add your elements echo $form; no description? Last edited by gerry22 : 06-22-2008 at 12:14 AM. Reason: meant ->setDescription() and not ->addDescription() |
|
|||
|
i don't know about the api, though...
lines 742 - 752 of /library/Form.php /** * Set form description * * @param string $value * @return Zend_Form */ public function setDescription($value) { $this->_description = (string) $value; return $this; } |
|
|||
|
The method name in that file is setDescription() but you are calling addDescription(). This explains why I did not find it in the manual or the API, I was searching for addDescription as your per your post. Try $form->setDescription().
Last edited by jweber : 06-21-2008 at 11:23 PM. |
|
|||
|
$form = new Zend_Form();
$form->setDescription('testing testing one two'); Zend_Debug::dump($form); echo $form; Code:
object(Zend_Form)#45 (23) {
["_attribs:protected"] => array(0) {
}
["_decorators:protected"] => array(3) {
["Zend_Form_Decorator_FormElements"] => object(Zend_Form_Decorator_FormElements)#47 (4) {
["_placement:protected"] => string(6) "APPEND"
["_element:protected"] => NULL
["_options:protected"] => array(0) {
}
["_separator:protected"] => string(2) "
"
}
["Zend_Form_Decorator_HtmlTag"] => object(Zend_Form_Decorator_HtmlTag)#49 (6) {
["_placement:protected"] => NULL
["_tag:protected"] => NULL
["_tagFilter:protected"] => NULL
["_element:protected"] => NULL
["_options:protected"] => array(2) {
["tag"] => string(2) "dl"
["class"] => string(9) "zend_form"
}
["_separator:protected"] => string(2) "
"
}
["Zend_Form_Decorator_Form"] => object(Zend_Form_Decorator_Form)#48 (5) {
["_helper:protected"] => string(4) "form"
["_placement:protected"] => string(6) "APPEND"
["_element:protected"] => NULL
["_options:protected"] => array(0) {
}
["_separator:protected"] => string(2) "
"
}
}
["_defaultDisplayGroupClass:protected"] => string(22) "Zend_Form_DisplayGroup"
["_description:protected"] => string(23) "testing testing one two"
["_disableLoadDefaultDecorators:protected"] => bool(false)
["_displayGroupPrefixPaths:protected"] => array(0) {
}
["_displayGroups:protected"] => array(0) {
}
["_elementPrefixPaths:protected"] => array(0) {
}
["_elements:protected"] => array(0) {
}
["_elementsBelongTo:protected"] => NULL
["_errorsExist:protected"] => bool(false)
["_formOrder:protected"] => NULL
["_isArray:protected"] => bool(false)
["_legend:protected"] => NULL
["_loaders:protected"] => array(1) {
["DECORATOR"] => object(Zend_Loader_PluginLoader)#46 (3) {
["_prefixToPaths:protected"] => array(1) {
["Zend_Form_Decorator_"] => array(1) {
[0] => string(20) "Zend/Form/Decorator/"
}
}
["_loadedPlugins:protected"] => array(3) {
["FormElements"] => string(32) "Zend_Form_Decorator_FormElements"
["HtmlTag"] => string(27) "Zend_Form_Decorator_HtmlTag"
["Form"] => string(24) "Zend_Form_Decorator_Form"
}
["_useStaticRegistry:protected"] => NULL
}
}
["_methods:protected"] => array(4) {
[0] => string(6) "delete"
[1] => string(3) "get"
[2] => string(4) "post"
[3] => string(3) "put"
}
["_order:protected"] => array(0) {
}
["_orderUpdated:protected"] => bool(false)
["_subFormPrefixPaths:protected"] => array(0) {
}
["_subForms:protected"] => array(0) {
}
["_translator:protected"] => NULL
["_translatorDisabled:protected"] => bool(false)
["_view:protected"] => NULL
}
|
|
|||
|
thanks for the information.
|
|
|||
|
Set the description decorator and it will be displayed.
Code:
$form->setDecorators(array(
'Description',
'FormElements',
'Form'
));
$form->setDescription('description here...);
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|