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 8387125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:07:41+00:00 2026-06-09T18:07:41+00:00

I have a zend form in which I need each element to be wrapped

  • 0

I have a zend form in which I need each element to be wrapped by a display group. Then I need a group of elements to be wrapped in another display group. Since zend form does not support nested display groups I use subform instead.

So, my structure now is:

Form
--- SubForm (1)
--- --- DisplayGroup (1-1)
--- --- --- Element (1)
--- --- DisplayGroup (1-2)
--- --- --- Element (2)
--- SubForm (2)
--- --- DisplayGroup (2-1)
--- --- --- Element (3)
--- --- DisplayGroup (2-2)
--- --- --- Element (4)

etc.

From this, however, comes the problem that each subform is set as a parent to each element that belongs to it. This changes the name of the element, f.e. name="username" becomes name="subformname[username]".

Since I am using the subform as a substitute of the display group, I don’t need it’s extra functionality.

How can I disable this changing of the names?

P.S.: I am using a custom function to “bulk process” each element (trivial stuff – remove decorators, set labels etc.), so I was able to force setAttrib('name', $element -> getName()), but it turns out that this only works for regular form elements. It does not work on ZendX form elements like datepickers, colorpickers etc.

  • 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-06-09T18:07:42+00:00Added an answer on June 9, 2026 at 6:07 pm

    From the comments you said you’re only using display groups to give the element a twitter bootstrap grid class. You don’t need to use display groups for this, just add an additional HtmlTag decorator to each form element, or add a class to one of the existing ones. Then you can use display groups for their intended purpose, giving you:

    Form
    --- DisplayGroup (1)
    --- --- Element (1)
    --- --- Element (2)
    --- DisplayGroup (2)
    --- --- Element (3)
    --- --- Element (4)
    

    if you have any trouble, edit your question to include the your ‘bulk process’ code that is modifying the existing decorators we can suggest how it could be modified.

    Edit: Getting a decorator to wrap the label and the form element is just down to the order in which your decorators are specified. Here’s an example:

    $element->addDecorator('ViewHelper')
            ->addDecorator('Errors')
            ->addDecorator('Description', array('tag' => 'p', 'class' => 'description'))
            ->addDecorator('Label', array('optionalSuffix' => ':', 'requiredSuffix' => ':*'))
            ->addDecorator(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'span4'));
    

    The viewHelper decorator renders the form element itself. Each subsequent decorator is wrapped ‘around’ the existing content. Exactly how that is rendered depends a bit on the decorator itself, but in the example above you’ll see a div tag with the class ‘span4’ as the last decorator, which means the div will wrap everything else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the Zend Form with some elements. And I need to placing some
About to create a form using Zend Form, all the form elements should have
I'm using Zend Framework and I currently have an existing form using zend-form which
I'm creating a Zend Form which includes a Zend Form Element File to allow
I have working user registration form. It consist of Zend Form Elements. Now I
hi i'm using zend form multicheckbox. I have an $array in which I have
I have a Form element: $Form=new Zend_Form; $Form->setAction($this->view->url(array('controller'=>'auth','action'=>'create'),null,true)) ->setMethod('post') ->setAttrib('id','auth-form') ->removeAttrib('enctype'); As can be
I am working on zend. I have a form with some checkboxes. I want
I'm using Zend forms. I have a form to add a row to a
I have a zend form that I'm initializing as follows: $form = new Form_XYZ();

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.