I'm attempting to create a custom form field in Zend_Form
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:
/application/forms/elements/SwfUpload.php
SwfUploadHelper.php
These files are autoloaded in Bootstrap (well, SwfUpload.php certainly is) .
SwfUpload.php:
class Custom_Form_Element_SwfUpload extends Zend_Form_Element
{
public $helper = 'swfUpload';
}
SwfUploadHelper.php:
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;
}
}
when i instantiate this class like this:
class Form_ApplicationForm extends Zend_Form
{
public function init()
{
$custom = new Custom_Form_Element_SwfUpload('swfupload');
// etc etc
I get this error:
Message: Plugin by name 'SwfUpload' was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/:/home/mysite/application/views/helpers/
Is it the case that it's expecting my helper to be in "home/mysite/application/views/helpers/
"? 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.