Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4331148
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:04:01+00:00 2026-05-21T10:04:01+00:00

how to decorate zend form element to put label in tr and element in

  • 0

how to decorate zend form element to put label in tr and element in tr

<tr><td><label>name</label></td></tr>
<tr><td><input type="text"/></td></tr>

i use this code

$this->setElementDecorators(
    array('ViewHelper',
    array(array('data'=>'HtmlTag'),array('tag'=>'td','class'=>'element_td')),
    array('Label',array('tag'=>"td")),
    array(array('row'=>'HtmlTag'),array('tag'=>'tr'))
    )
);

but it produce label and elemment in same row[tr]
i want label in row and the element in another row how to do this??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:04:01+00:00Added an answer on May 21, 2026 at 10:04 am

    It’s a bit tricky to do this with the decorators, but it’s possible. Since you want to wrap two individual components within tags that are separate from each other, what you must do is first wrap one of them using the HtmlTag decorator, and after that build the other one by appending decorators after it (or optionally the other way around and prepending):

    $this->setElementDecorators(array(
        array('Label'),
        array(array('labelTd'=>'HtmlTag'),array('tag'=>'td','class'=>'label_td')),
        array(array('labelTr'=>'HtmlTag'),array('tag'=>'tr','class'=>'label_tr')),
        array(array('elementOpenTr'=>'HtmlTag'),array('tag'=>'tr','class'=>'element_tr','openOnly'=>true,'placement'=>'append')),
        array(array('elementOpenTd'=>'HtmlTag'),array('tag'=>'td','class'=>'element_td','openOnly'=>true,'placement'=>'append')),
        array('ViewHelper', array('placement' => 'append')),
        array(array('elementCloseTd'=>'HtmlTag'),array('tag'=>'td','closeOnly'=>true,'placement'=>'append')),
        array(array('elementCloseTr'=>'HtmlTag'),array('tag'=>'tr','closeOnly'=>true,'placement'=>'append'))
    ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having an incredibly difficult time to decorate a Zend form the way
in my zend form i set decarators to each element , instead of that
Please see this simple fiddle http://jsfiddle.net/75qSD/ I want it to decorate the element as
I am trying to decorate an actual class, using this code: def my_decorator(cls): def
How do you unit test code decorated with the PrincipalPermission attribute? For example, this
I need to decorate a standard html button. The base element I took <button>
I'd like to decorate a function, using a pattern like this: def deco(func): def
Using the Zend Framework , I have a menu and want to put it
I use the following attribute to decorate my BaseController class. public class OutputCompressAttribute :
when use new virtual key words to decorate the method? what is the affection?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.