|
|||
|
I would like to create a custom Form Element which is essentially a Textarea with some javascript to turn it into a WYSIWYG editor (using NicEditor). I thought the best way to do this would be would be something like this
PHP Code:
PHP Code:
What I settled on do was overwriting the render method as follows: PHP Code:
|
|
|||
|
In my apps I set the view helper path in the bootstrap.
PHP Code:
|
|
|||
|
After adding a
$this->addPrefixPath('Form_Element', 'Form/Element', 'ELEMENT'); in a form constructor my special element is fine but it does not find the standard form elements 'submit'. Putting trace code in the plugin loader it appears that Zend_Loader::isReadable is saying it found a submit.php in my path, but there isn't so it fails to include the path and find the class. This feels like a php error. Any Ideas? |
|
|||
|
I tried this
PHP Code:
Yes Warning: include_once(Form/Element/Submit.php) [function.include-once]: failed to open stream: No such file or directory in I:\ws2\chunt\test.php on line 11 Warning: include_once() [function.include]: Failed opening 'Form/Element/Submit.php' for inclusion (include_path=';I:/ws2;I:/ws2/Library') in I:\ws2\chunt\test.php on line 11 That is the cause of my problem |
|
|||
|
Ok got it but Why?
It seems that Zend is by default in the library path so it finds the real Element class but expectes it to have my prefix. So do not use a prefix / path that maps to a Zend sub path. i.e I needed to change my Form to FormExtension or something else but not Form. I do not know why it took me so liong to get this!! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|