I am a newbie, and getting this error:
- Fatal error: Class 'Form_UploadBom' not found in C:\wamp\NetBeansProjects\bomSlave\application\controllers\BomController.php on line 18
What am I missing ??
What am I doing wrong??
As you'd expect, line 18 of BomController.php is where I call for an instance of my form.
17. public function uploadAction() {
18. $form = new Form_UploadBom();
19. $this->view->form = $form;
20. }
My form is at //application/forms/uploadbom.phtml
class Form_UploadBom extends Zend_Form {
public function __construct($option = null) {
parent::__construct($option);
$this->setName('bomupload');
$company = new Zend_Form_Element_Text('co');
$company->setLabel('Cust Company:')
->setRequired();
$contact = new Zend_Form_Element_Text('contact');
$contact->setLabel('Cust Contact')
->setRequired();
$file = new Zend_Form_Element_File('bom');
$file->setLabel('BOM File (in CSV):')
->setRequired();
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Uplaod BOM');
$this->addElements(array( $company, $contact, $file, $submit ));
$this->setMethod('post');
$this->setAction('');
}
}
And here's the Auto Loader from my Bootstrap file
protected function _initAutoLoad(){
$autoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH,
'resourceTypes' => array (
'model' => array(
'path' => 'models/',
'namespace' => 'Model_',
),
'form' => array(
'path' => 'forms/',
'namespace' => 'Form_',
)
)
)
);
return $autoloader;
}
Again, what am I missing ??
What am I doing wrong??
(and please don't tell me it's just a type-o somewhere ...
...that would just be embarrassing :)
~ Mo
[[EDIT]]
Well, after changing the file extension from phtml to php, that error is gone ... but ... I now have an error about view helpers.
- Warning: Missing argument 1 for Zend_View_Helper_Form::form() ....
And this notice:
- Notice:* Undefined variable: name in C:\wamp\bin\php\ZendFramework\1.11.11\library\Zend\View\Helper\Form.php on line 46
How does all that come into play ??
[[/EDIT]]
init()method, instead of in the constructor. Shouldn't matter, since your constructor calls the parent constructor, but worth a try anyway. - David Weinraub