DMillasich (5) [Avatar] Offline
#1
This seems very odd. I have an application with several forms, each of which is composed of a few controls of various types. The app is using version 1.9 of the Zend Framework. Everything works fine, until I upload the app to the shared hosting webserver (2 different providers: Godaddy, and WebFaction).

My application is able to render forms with all of the controls except for "checkbox" types.

The error message that I get is:

Fatal error: Class 'Zend_Form_Element_CheckBox' not found in /home/application/forms/Beverage.php on line 35

This doesn't seem to be a pathing problem, as all of the other controls, such as "TextBox" and "Submit" are located in the zend/form/element directory.

The code that I'm having problems with is very simple -

<?php <br /> class Form_Beverage extends Zend_Form
{
public function __construct($options = null)
{
parent::__construct($options);
$this->setName('beverage');
$id = new Zend_Form_Element_Hidden('id');
$sequence = new Zend_Form_Element_Text('sequence');
$sequence->setLabel('Sequence')
->setRequired(true)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator('NotEmpty');
$item = new Zend_Form_Element_Text('item');
$item->setLabel('Beverage')
->setAttrib('size', 100)
->setRequired(true)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator('NotEmpty');
$description = new Zend_Form_Element_Text('description');
$description->setLabel('Description')
->setAttrib('size', 100)
->setRequired(false)
->addFilter('StripTags')
->addFilter('StringTrim');
$price = new Zend_Form_Element_Text('price');
$price->setLabel('Price')
->setRequired(true)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator('NotEmpty');
$askquote = new Zend_Form_Element_CheckBox('askquote');
$askquote->setLabel('Ask Quote');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$this->addElements(array($id, $sequence, $item, $description, $price, $askquote, $submit));
}
}
DMillasich (5) [Avatar] Offline
#2
Re: application unable to find "Zend_Form_Element_CheckBox"
Aye Yai Yai. User error:

Checkbox.php != CheckBox.php

Problem solved.