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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:23:04+00:00 2026-06-08T13:23:04+00:00

I’ve been working through the Apress book ‘Pro Zend Framework Techniques’. I’ve hit a

  • 0

I’ve been working through the Apress book ‘Pro Zend Framework Techniques’. I’ve hit a point where I am trying to render the form on a view.

The form is called BugReport, which is located at forms/BugReportForm.php; here is the contents of the file:

<?php

class Form_BugReportForm extends Zend_Form
{
   public function init()
   {
      // add element: author textbox
      $author = this->createElement('text', 'author');
      $author->setLabel('Enter your name:');
      $author->setRequired(TRUE);
      $author->setAttrib('size', 30);
      $this->addElement($author);

      // add element: email textbox
      $email = $this->createElement('text', 'email');
      $email->setLabel('Your email address:');
      $email->setRequired(TRUE);
      $email->addValidator(new Zend_Validate_EmailAddress());
      $email->addFilters(array(
         new Zend_Filter_StringTrim(),
         new Zend_Filter_StringToLower()
         ));
      $email = setAttrib('size', 40);
      $this->addElement($email);

      // add element: date textbox
      $date = $this->createElement('text', 'date');
      $date->setLabel('Date the issue occurred (dd-mm-yyyy)');
      $date->setRequired(TRUE);
      $date->addValidator(new Zend_Validate_Date('MM-DD-YYYY'));
      $date->setAttrib('size', 20);
      $this->addElement($date);

      // add element: URL textbox
      $url = $this->createElement('text', 'url');
      $url->setLabel('Issue URL:');
      $url->setRequired(TRUE);
      $url->setAttrib('size', 50);
      $this->addElement($url);

      // add element: description text area
      $description = $this->createElement('textarea', 'description');
      $description->setLabel('Issue description:');
      $description->setRequired(TRUE);
      $description->setAttrib('cols', 50);
      $description->setAttrib('rows', 4);
      $this->addElement($description);

      // add element: priority select box
      $priority = $this->createElement('select', 'priority');
      $priority->setLabel('Issue priority:');
      $priority->setRequired(TRUE);
      $priority->addMultiOptions(array(
         'low'   =>   'Low',
         'med'   =>   'Medium',
         'high'   =>   'High'
         ));
      $this->addElement($priority);

      // add element: status select box
      $status = $this->createElement('select', 'status');
      $status->setLabel('Current status:');
      $status->setRequired(TRUE);
      $status->addMultiOptions(array(
         'new'         =>   'New',
         'in_progress'   =>   'In Progress',
         'resolved'      =>   'Resolved'
         ));
      $this->addElement($status);

      // add element: submit button
      $this->addElement('submit', 'submit', array('label' => 'Submit'));
   }
}

This form in controlled via the BugController controller located at /controllers/BugController.php

<?php

class BugController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // action body
    }

    public function createAction()
    {
        // action body
    }

   public function submitAction()
   {
      $frmBugReport = new Form_BugReport();
      $frmBugReport->setAction('/bug/submit');
      $frmBugReport->setMethod('post');
      $this->view->form = $frmBugReport();
   }

}

And finally I have the following autoloaders in my bootstrap.

protected function _initAutoload()
{
   // Add autoloader empty namespace
   $autoLoader = Zend_Loader_Autoloader::getInstance();
   $resourceLoader = new Zend_Loader_Autoloader_Resource(array(
      'basePath'      => APPLICATION_PATH,
      'namespace'      => '',
      'resourceTypes'   => array(
         'form'   => array(
            'path'      => 'forms/',
            'namespace'   => 'Form_',
         )
      ),
   ));

   // Return it so it can be stored by the bootstrap
   return $autoLoader;
}

The error I am getting can be seen here: http://zend.danielgroves.net/bug/submit

Or, if you’d rather just read it: Fatal error: Class ‘Form_BugReport’ not found in /home/www-data/zend.danielgroves.net/htdocs/application/controllers/BugController.php on line 23

Any ideas on what I’ve done wrong, and so how this can be fixed?

Edit

ArneRie pointed out I was using the wrong class name, but unfortunately this hasn’t fixed the issue. Here’s how BugController looks now:

<?php

class BugController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // action body
    }

    public function createAction()
    {
        // action body
    }

    public function submitAction()
    {
        $frmBugReport = new Form_BugReportForm();
        $frmBugReport->setAction('/bug/submit');
        $frmBugReport->setMethod('post');
        $this->view->form = $frmBugReport;
    }

}

Although this did get rid of the error in question, a new one has taken it’s place.

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/www-data/zend.danielgroves.net/htdocs/application/forms/BugReportForm.php on line 8

Line 8 is interestingly /* Initialize action controller here */

  • 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-08T13:23:07+00:00Added an answer on June 8, 2026 at 1:23 pm

    Try it with: $frmBugReport = new Form_BugReportForm();

    You’re using the wrong class name.

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

Sidebar

Related Questions

I am trying to render a haml file in a javascript response like so:
I am trying to loop through a bunch of documents I have to put
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.