creating a custom form element in Zend_Form

The Business

New Member
I'm attempting to create a custom form field in \[code\]Zend_Form\[/code\] to store a snippet of HTML that is required by SWFUpload(for the purposes of a flash file uploader).I've tried following a few different tutorials but i'm getting pretty confused, so far this is what i have:\[code\]/application/forms/elements/SwfUpload.php SwfUploadHelper.php\[/code\]These files are autoloaded in Bootstrap (well, SwfUpload.php certainly is) .SwfUpload.php:\[code\]class Custom_Form_Element_SwfUpload extends Zend_Form_Element{ public $helper = 'swfUpload';}\[/code\]SwfUploadHelper.php:\[code\]class Custom_Form_Helper_SwfUpload extends Zend_View_Helper_FormElement{ public function swfUpload() { $html = '<div id="swfupload-control"> <p>Upload upto 5 image files(jpg, png, gif), each having maximum size of 1MB(Use Ctrl/Shift to select multiple files)</p> <input type="button" id="button" /> <p id="queuestatus" ></p> <ol id="log"></ol> </div>'; return $html; }}\[/code\]when i instantiate this class like this:\[code\]class Form_ApplicationForm extends Zend_Form{ public function init() { $custom = new Custom_Form_Element_SwfUpload('swfupload'); // etc etc\[/code\]I get this error:\[quote\] Message: Plugin by name 'SwfUpload' was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/:/home/mysite/application/views/helpers/\[/quote\]Is it the case that it's expecting my helper to be in "\[code\]home/mysite/application/views/helpers/\[/code\]"? I've tried creating the same helper in there with the filename "SwfUpload.php" but the error remains. Not sure i this is purely a filename/path issue or something else.thanks.
 
Back
Top