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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:23:46+00:00 2026-06-09T00:23:46+00:00

I have a text element declared this way: $name = $this->createElement(‘text’, ‘name’); $name->setLabel(‘imie:’); I

  • 0

I have a text element declared this way:

$name = $this->createElement('text', 'name');
$name->setLabel('imie:');

I want to decorate this element to get it rendered like this:

<div class="row">
  <span class="label">
    <label for="name" class="highlight">Name</label>
  </span>
  <span class="formw">
    <input type="text"  id="someid" name="name" class="textfield">
  </span>
</div>

I can’t manage to get it work properly.
Could somebody help me with setting decorators for that?

  • 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-09T00:23:48+00:00Added an answer on June 9, 2026 at 12:23 am

    Use the viewScript Decorator:

    the partial @ `views/scripts/_partial.phtml (name it what you want)

    <form action="<?php echo $this->element->getAction() ?>"
          method="<?php echo $this->element->getMethod() ?>">
        <div class="row">
            <span class="label">
                <?php echo $this->element->name->renderLabel() //render the label for element ?>
            </span>
            <span class="formw">
                <?php echo $this->element->name->renderViewHelper() //render just the input of the element ?>
            </span>
            <?php echo $this->element->submit //render the whole submit element ?>
        </div>
    </form>
    

    In your form set the decorator :

    class Application_Form_NewForm extends Zend_Form
    {
        public function init() {
            $this->setMethod('POST');
            //set the viewscript decorator
            $this->setDecorators(array(
                array('ViewScript', array(
                        'viewScript' => '_partial.phtml'
                ))
            ));
        //more follows...
    

    Now just render your form as usual

    You may have to play with the element decorators to exactly what you want but this should get you close to your goal.

    Hope this helps…

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

Sidebar

Related Questions

I have a text file like this: A B C And each element has
I have an html td element with text inside. I want it so you
I have an INPUT element of the TEXT type and I want to perform
I have an anchor element that looks like this <a href=url><img src=imgurl/>Text</a> I would
Wondering if this is possible: Let's say if I have a text input element
I have text input element and an event is fired on blur event and
I have a Raphael text element with both a mouseup and click event handler.
I have a function that changes a dom element's text to a given value,
I have a div element containing some text. When the user clicks a word
I have seen XML Schema element with attributes containing only text but I have

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.