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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:33:57+00:00 2026-06-04T07:33:57+00:00

i am new to zend i have coded up to some extent but dont

  • 0

i am new to zend i have coded up to some extent but dont know further how to decorate my form using decorators etc

this is my old HTML

<div class="col_6 pre_3 padding_top_60" style="padding-top:0">
<div class="widget clearfix">
    <div class="widget_inside">
        <p class="margin_bottom_15">Kindly enter Username and  Password.</p>
        <span><?= $this->error;?></span>
        <form method='post' action='<?php echo $this->url(array(), 'login') ?>' onsubmit="return validateForm();">
            <div class="form">
                <div class="clearfix" id="div_username">
                    <label class="lable-2">Username</label>
                    <div class="input">
                        <input type="text" class="xlarge" name="username" id="username" value="<?php echo $this->form['username'] ?>"/>
                        <span id="error_message_username"></span>
                    </div>
                </div>
                <div class="clearfix" id="div_password">
                    <label class="lable-2">Password</label>
                    <div class="input">
                        <input type="password" class="xlarge" name="password" id="password" value="<?php echo $this->form['password'] ?>"/>
                        <span id="error_message_Password"></span>
                    </div>
                </div>
                <div class="clearfix">
                <label></label>
                    <div class="input">
                        <input type="checkbox" name="remember" value="1" <?php echo ($this->form['remember'] == 1)?'checked="checked"':'' ?>/></span> Stay signed in
                        <span style="margin-left:10px">Forgot <a href="javascript: void(0);" rel="UserID" id="forgot_userid">User ID</a> or <a href="javascript: void(0);" rel="Password" id="forgot_password">Password</a> </span>
                    </div>
                </div>

                <div class="clearfix">
                    <label></label>
                    <div class="input">
                        <input type="submit" value="Login"  class="medium button blue blue-1"/>
                </div> </div>
            </div>
        </form>
    </div>
</div>

This is my Form

<?php

class Application_Form_Loginform extends Zend_Form{

public function init()
{
    /* Form Elements & Other Definitions Here ... */

    $this->setMethod('post');
    $this->addElement('text','username',array(
        'label'     => 'UserName :',
        'required'  => true,
        'filters'   => array('StringTrim')
    ));

    $this->addElement('password','password',array(
        'label'    => 'Password',
        'required' => 'true',
        'filters'  => array('StringTrim')
    ));
    $this->addElement('submit','submit',array(
       'ignore'=>'true',
       'label'=>'Login'
    ));
}

}

Question is How can i make my form made with php equal to the above HTML ??

  • 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-04T07:33:58+00:00Added an answer on June 4, 2026 at 7:33 am

    Zend Form is a pain to use, especially decorators.

    You should use the View Script decorator instead.

    See here: http://framework.zend.com/manual/en/zend.form.standardDecorators.html#zend.form.standardDecorators.viewScript

    Aside from Zend Form decorators having a high learning curve, it mixes view code with logic and validation code.

    This is not a good thing, especially if you have frontend developers styling and working with the forms.

    It also makes prototyping the look of the forms difficult since you have to keep adjusting the decorator code.

    With that said, Zend Form does a good job of making validation relatively painless. But one other gripe with it is that I don’t think it fits well model validation.

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

Sidebar

Related Questions

I am using Zend Dom component to parse some Html blocks, but i have
I started using zombiejs, but i have some begginer questions: 1.) How testing ajax
I have some experience in Zend framework. Recently I started to using Yii. Now
I have been building a dynamic form in my Zend Framework application using Jquery
I am pretty new to the zend framework and the JQuery helper. I have
I'm new to Zend Framework. I would like to know how to implement zend
I am quite a new Zend Framework user but I am not new to
Hi every one first of all im new in zend and i need some
I'm fairly new to Zend and am having some difficulties with creating my unit
I am using poedit with zend_translate. I have done everything required in zend. I

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.