Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-04-2008, 07:26 AM
Junior Member
 
Join Date: May 2008
Posts: 6
Default Form->setDescription('test'); not working?

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()
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-20-2008, 11:36 PM
Junior Member
 
Join Date: May 2008
Posts: 6
Default

315 views and not one comment?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-21-2008, 08:25 PM
Member
 
Join Date: Jun 2008
Location: Florida
Posts: 94
Default

Where is this method referenced in the manual? I dont see it there or in the API. Maybe I am just not looking close enough.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-21-2008, 10:59 PM
Junior Member
 
Join Date: May 2008
Posts: 6
Default

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;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-21-2008, 11:20 PM
Member
 
Join Date: Jun 2008
Location: Florida
Posts: 94
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-22-2008, 12:11 AM
Junior Member
 
Join Date: May 2008
Posts: 6
Default

no, it still doesn't work.

I think i meant to write setDescription() in the above post.

Anyhow, it still don't work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-22-2008, 12:38 AM
Member
 
Join Date: Jun 2008
Location: Florida
Posts: 94
Default

what are the contents of print_r($form) after setting the description?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-22-2008, 09:57 PM
Junior Member
 
Join Date: May 2008
Posts: 6
Default

$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
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 07-15-2008, 02:52 PM
Junior Member
 
Join Date: Jul 2008
Posts: 6
Default

thanks for the information.
__________________
Brandy Thomas | Sex | Porn
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 07-27-2008, 01:09 PM
Junior Member
 
Join Date: May 2008
Posts: 6
Default fixed, though i think it should be default.

Set the description decorator and it will be displayed.

Code:
$form->setDecorators(array(
            'Description',
            'FormElements',
            'Form'
        ));

$form->setDescription('description here...);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:54 PM.