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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:59:26+00:00 2026-06-10T23:59:26+00:00

I have a form and I would like to customise the markup for it.

  • 0

I have a form and I would like to customise the markup for it. Im using the decorators at the bottom of the class. However, I keep getting the error:

Exception caught by form: No file decorator found.

I was wondering if someone would be able to show me an example. I basically want to output the form as and do away with the standard layout. Maybe add a few custom classes also.

Updated

class Application_Form_Admin extends Zend_Form
{

    public function init()
    {
        // Set the method for the display form to POST
        $this->setMethod('post');

        // set the data format
        $this->setAttrib('enctype', 'multipart/form-data');

        // Add the entry id
        $this->addElement('hidden', 'id', array(
            'required'   => false
        ));

        // Add the title
        $this->addElement('text', 'title', array(
            'label'      => 'Project Title',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 60))
                )
        ));

        // Add the title
        $this->addElement('text', 'appid', array(
            'label'      => 'App Id',
            'required'   => true,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 60))
                )
        ));

        // Add the title
        $this->addElement('text', 'appsecret', array(
            'label'      => 'App Secret',
            'required'   => true,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 60))
                )
        ));

        // Add the title
        $this->addElement('text', 'namespace', array(
            'label'      => 'Namespace',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 60))
                )
        ));

        // Add the title
        $this->addElement('text', 'applink', array(
            'label'      => 'App Link',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 255))
                )
        ));

        // Facebook Only?
        $this->addElement('checkbox', 'fbonly', array(
            'label'      => 'Facebook Only',
            'required'   => false,
            'value'      => 1
        ));

        // general app data group
        $this->addDisplayGroup(array('title', 'appid', 'appsecret', 'namespace', 'applink', 'fbonly'), 'general', array('legend' => 'General Optons'));

        // Facebook Only?
        $this->addElement('checkbox', 'fangate', array(
            'label'      => 'Fangate Page',
            'required'   => false,
            'value'      => 1
        ));

        // Facebook Only?
        $this->addElement('checkbox', 'welcome', array(
            'label'      => 'Welcome Page',
            'required'   => false,
            'value'      => 1
        ));

        // Facebook Only?
        $this->addElement('checkbox', 'help', array(
            'label'      => 'Help Page',
            'required'   => false,
            'value'      => 1
        ));

        // Facebook Only?
        $this->addElement('checkbox', 'entries', array(
            'label'      => 'Entries Page',
            'required'   => false,
            'value'      => 1
        ));

        // pages enabled group
        $this->addDisplayGroup(array('fangate', 'welcome', 'help', 'entries'), 'page', array('legend' => 'Page Optons'));

        // Add the title
        $this->addElement('text', 'ogtype', array(
            'label'      => 'Default Open Graph Type',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 60))
                )
        ));

        // Add the title
        $this->addElement('text', 'ogtitle', array(
            'label'      => 'Default Open Graph Title',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 60))
                )
        ));

        // Add the title
        $this->addElement('text', 'ogdesc', array(
            'label'      => 'Default Open Graph Description',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 60))
                )
        ));

        // Add the title
        $this->addElement('file', 'ogimage', array(
            'label'      => 'Default App Image',
            'required'   => false
        ));

        // generic open graph data
        $this->addDisplayGroup(array('ogtype', 'ogtitle', 'ogdesc', 'ogimage'), 'og', array('legend' => 'Generic Open Graph data'));

        // Add the wall title
        $this->addElement('text', 'apptitle', array(
            'label'      => 'App Title',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 60))
                )
        ));

        // Add the wall caption
        $this->addElement('text', 'appcaption', array(
            'label'      => 'App Caption',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 60))
                )
        ));

        // Add the wall message
        $this->addElement('text', 'appdesc', array(
            'label'      => 'App Description',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 255))
                )
        ));

        // app message details
        $this->addDisplayGroup(array('apptitle', 'appcaption', 'appdesc'), 'appdetails', array('legend' => 'App deatils (Used when sharing)'));

        // Add the wall title
        $this->addElement('text', 'wallmsg', array(
            'label'      => 'Wall Message',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 255))
                )
        ));

        // Add the wall title
        $this->addElement('text', 'friendmsg', array(
            'label'      => 'Friends Wall Message',
            'required'   => false,
            'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 255))
                )
        ));

        // app message details
        $this->addDisplayGroup(array('wallmsg', 'friendmsg'), 'wallmessages', array('legend' => 'Wall post messages'));

        // Add the submit button
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Submit',
        ));

        // And finally add some CSRF protection
        $this->addElement('hash', 'csrf', array(
            'ignore' => true,
        ));

        // change markup of elements
        $this->setElementDecorators(array(
            'ViewHelper',
            array(
                'Description',
                array(
                    'tag'    => 'div',
                    'class'  => 'submit-button',
                    'escape' => false
                )
            ),
            array(
                array(
                    'data' => 'HtmlTag'
                ),
                array(
                    'tag'   => 'span',
                    'class' => 'element'
                )
            ),
            array(
                'Label',
                array(
                    'tag'    => 'label',
                    'class' => 'elementLabel',
                    'escape' => false
                )
            ),
            'File',
            array(
                array(
                    'data' => 'HtmlTag'
                ),
                array(
                    'tag'   => 'span',
                    'class' => 'element'
                )
            ),
            array(
                array(
                    'row' => 'HtmlTag'
                ),
                array(
                    'tag'   => 'li',
                    'class' => 'element-row'
                ),
            ),
            'Errors'
        ));

        // change markup of form
        $this->setDecorators(array(
            'FormElements',
            array(
                'HtmlTag',
                array(
                    'tag' => 'div',
                    'id'  => $this->_containerId
                )
            ),
            'Form',
            'Errors'
        ));

    }


}
  • 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-10T23:59:28+00:00Added an answer on June 10, 2026 at 11:59 pm

    You have at least one "File" element in your form, you called setDecorators and did not include the "File" decorator, which is a required decoratotr for a ‘File’ element:

    35.6.4. Zend_Form_Element_File

    The File form element provides a mechanism for supplying file upload fields to your form. It utilizes
    Zend_File_Transfer internally to provide this functionality, and the
    FormFile view helper as also the File decorator to display the form
    element.

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

Sidebar

Related Questions

I would like to have Ajax form in Rails so i'm using form_remote_tag. The
I'm trying to generate a form using crispy form and would like to have
I have two form fields and would like to post those values using jquery
I have a simple form and would like to add a custom jQuery validation
I would like to have a form that can submit to two different action
I have a long signup form and would like to hide a few fields
We have a form which uses the JQuery Validation Plugin and would like to
I have a form that has label values that I would like to pass
I have a form with two selectfields. I would like that when something is
I have a form which includes a data sheet. I would like to make

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.