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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-12-2008, 07:47 AM
Junior Member
 
Join Date: Mar 2008
Posts: 8
Question Custom decorator problem

I'm trying to understand how Zend_Form works. I've coded a Cms_Decorator_Label that extends Zend_Form_Decorator_Abstract (it writes a ':' after label text) but I cannot make it work correctly at a custo UserForm (extends Zend_Form)

try 1)
Code:
$this -> addPrefixPath('Cms_Decorator', 'Cms/Decorator/','decorator');
don't works

try 2)
Code:
$this -> addElementPrefixPath('Cms_Decorator', 'Cms/Decorator/','decorator');
don't works

try 3)
Code:
    $name = new Zend_Form_Element_Text('name');    
    $name -> addPrefixPath('Cms_Decorator', 'Cms/Decorator/','decorator');
don't works

try 4)
Code:
 $form = new UserForm(array('disableLoadDefaultDecorators' => true));
don't works

try 5)
Code:
$name = new Zend_Form_Element_Text('name',array('disableLoadDefaultDecorators' => true));
Element dissapears... we have something

try 6)
Code:
    $name = new Zend_Form_Element_Text('name',array('disableLoadDefaultDecorators' => true));    
    $name -> addPrefixPath('Cms_Decorator', 'Cms/Decorator/','decorator');
still invisible

try 7)
Code:
    $name = new Zend_Form_Element_Text('name',array('disableLoadDefaultDecorators' => true));    
    $name -> addPrefixPath('Cms_Decorator', 'Cms/Decorator/','decorator');
    $name -> addDecorator('Label');
ey!! A label with ':' !!! but it loses <dt> tag =/

try 8)
Code:
    $name = new Zend_Form_Element_Text('name',array('disableLoadDefaultDecorators' => true));    
    $name -> addPrefixPath('Cms_Decorator', 'Cms/Decorator/','decorator');
    $name -> addDecorator('Label',array('tag' => 'dt'));
not <dt> tag...

try 9)
search at zfforums -> nothing found -> write a post... =/

I've also tryed to don't disable default decoratos and add decorator class to element with:
Code:
$name -> addDecorator(new Cms_Decorator_Label(),array('tag' => 'dt'));
but then it write two labels (default and custom)

is there an easy way to do this?? i just want to create a custom decorator... =/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-29-2008, 01:55 AM
troy's Avatar
Junior Member
 
Join Date: Apr 2008
Posts: 11
Default

Got the same problem.
Can't get the disableLoadDefaultDecorators => true to work

Have you figured this out?
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 11:50 AM.