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

  • Home
  • SEARCH
  • 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 4051470
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:11:55+00:00 2026-05-20T14:11:55+00:00

So I use a zend framework, but for all commercial projects I am not

  • 0

So I use a zend framework, but for all commercial projects I am not using zend form component.
HTML+Js coders are working on frontend and I don’t want to have nothing with it, I just connect the final view in my zf based application.

So for example I have in view a html form which looks like this:

http://pastie.org/1668143

So form design, elements and classes can be changed by frontend coders, and I want to know is there easy way for me, to use zend form with this concept (in each project form code looks different of course )?

My main problem here is code duplication in my controllers, which in this case looks something like this:

http://pastie.org/1668023 (please don’t take exceptions and loggedMember seriously, they are just used for this snippet, to demonstrate a problem, which I have)

So, what would be the best solution for problem which I have, what do u think 🙂 ?

  • 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-20T14:11:56+00:00Added an answer on May 20, 2026 at 2:11 pm

    If you have absolutely no control over the form’s html structure, but still want to maximize the use of Zend_Form’s features, use Zend_Form_Decorator_ViewScript.

    http://framework.zend.com/manual/en/zend.form.standardDecorators.html (last section)

    $element->setDecorators(array(array('ViewScript', array(
    'viewScript' => '_element.phtml',
    'class'      => 'form element'
    ))));
    

    I would do it like this:

    1. create a form class that has all elements, validators and filters
    2. create an instance of the form in your action and set the view script(s) (this way you can change them per controller and still have very little duplicated definition code.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Zend Framework 1.6 hence I'm not utilizing Zend_Application. I have a
I'm starting to familiarize myself with using the module-based architecture for zend framework projects.
I'd like to use Zend framework in my server, but it's Windows and I
I'm using the Zend Framework to create an API I want to use apache
I would like to use ON DUPLICATE KEY UPDATE in Zend Framework 1.5, is
I am searching for a tutorial (optimally with Zend Framework) on how to use
I am trying to write a short Rest Service with Zend Framework. But the
I have been reading up on multiple PHP frameworks, especially the Zend Framework but
Ok, I've got Zend all set up and my hello world pages working. Personally,
I recently got PHPUnit working with xDebug for testing my Zend Framework applications. The

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.