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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:48:03+00:00 2026-05-21T20:48:03+00:00

in my zend form i set decarators to each element , instead of that

  • 0

in my zend form i set decarators to each element , instead of that can i set single decorater that can applicable to all.

currently ..

    $code = new Zend_Form_Element_Text("mealplancode");
    $code->setLabel("Code :");
    $code->setDecorators(
                         array(
                              array('ViewHelper',
                                        array('helper' => 'formText')
                            ),
                            array('HtmlTag',
                                        array('tag' => 'div', 'class' => '')
                            ),
                            array('Label',
                                        array('class' => 'label')
                            ),
                         )
                      );

    $name = new Zend_Form_Element_Text("mealplanname");
    $name->setLabel("Name :");
    $name->setDecorators(
                         array(
                              array('ViewHelper',
                                        array('helper' => 'formText')
                            ),
                            array('HtmlTag',
                                        array('tag' => 'div', 'class' => '')
                            ),
                            array('Label',
                                        array('class' => 'label')
                            ),
                         )
                      );

i want to set decorators to both $name and $code in a single setDecorator()
can i 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-21T20:48:04+00:00Added an answer on May 21, 2026 at 8:48 pm

    In your form class define a decorator field to be able to apply it to any form element, e.g.:

    public $elementDecorators = array(
            'ViewHelper',
                array(array('data'=>'HtmlTag'), array('tag' => 'td')),
                array('Label', array('tag' => 'td')),
                array(array('row'=>'HtmlTag'),array('tag'=>'tr'))); 
    

    And like in your code you can set the decorator:

    $formElement->setDecorators($this->elementDecorators);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I am trying to set up element custom validator in a zend form
hi i am using zend form , i created a Zend_Form_Element_Radio element that have
I'm currently building my own set of Form elements with Zend_Form and want all
I have a zend form in which I need each element to be wrapped
I learnt that I can set the ignore flag on a Zend_Form_Element so that
I'm trying to set the prefix path for Zend Form's validators and filters automatically.
I have created one form that extends zend form. For Adding New Record it
I created a stand alone zend form for uploading files and I set the
I have a simple Zend-based form with reCaptcha element: $form = new Zend_Form(); $form->setName('forgotpassword')
How use partial decorator in Jquery Element I use this code for Form Element:

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.