-- Ralf Eggert <[EMAIL PROTECTED]> wrote
(on Monday, 20 October 2008, 07:31 PM +0200):
> Hi,
> 
> I have this short form class:
> 
> -------------------------------------------------------------------------
>   class Form_PizzaCreate extends Zend_Form
>   {
>       public function init()
>       {
>           // lege Attribute für Formular fest
>           $this->setAction('/pizza/create');
> 
>           // erstelle Formularelement für Pizza Name
>           $pizzaName = new Zend_Form_Element_Text('name');
> 
>           // füge zwei Filterobjekte hinzu
>           $pizzaName->addFilter('Zend_Filter_Alpha');

Plugins are a strange beast. To get them to work properly, we have two
ways you can specify them:

  * Pass in a concrete instance
  * Pass in the name of the plugin, minus class prefix

Why not the full class name? Because of the way the plugin loader works.
You pass a common class prefix and a path to search for the plugin.

So, in the case above, you would pass simply 'Alpha'.

>       }
>   }
> -------------------------------------------------------------------------
> 
> When I try to initialize this form I get the following error:
> 
> -------------------------------------------------------------------------
> Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception'
> with message 'Plugin by name Zend_Filter_Alpha was not found in the
> registry.' in
> /home/devhost/zfbuch/ZendFramework-1.6.2/library/Zend/Loader/PluginLoader.php:370
> Stack trace: #0
> /home/devhost/zfbuch/ZendFramework-1.6.2/library/Zend/Form/Element.php(1937):
> Zend_Loader_PluginLoader->load('Zend_Filter_Alp...') #1
> /home/devhost/zfbuch/ZendFramework-1.6.2/library/Zend/Form/Element.php(1613):
> Zend_Form_Element->_loadFilter(Array) #2
> /home/devhost/zfbuch/ZendFramework-1.6.2/library/Zend/Form/Element.php(524):
> Zend_Form_Element->getFilters() #3
> /home/devhost/zfbuch/ZendFramework-1.6.2/library/Zend/Form/Element.php(541):
> Zend_Form_Element->_filterValue(NULL, NULL) #4
> /home/devhost/zfbuch/ZendFramework-1.6.2/library/Zend/Form/Decorator/ViewHelper.php(201):
> Zend_Form_Element->getValue() #5
> /home/devhost/zfbuch/ZendFramework-1.6.2/library/Zend/Form/Decorator/ViewHelper.php(231):
> Zend_Form_Decorator_ViewHelper->getValue(Object(Zend_Form_Element_Text))
> #6 /home/devh in
> /home/devhost/zfbuch/ZendFramework-1.6.2/library/Zend/Loader/PluginLoader.php
> on line 370
> -------------------------------------------------------------------------
> 
> When I use
>   $pizzaName->addFilter('Alpha')
> or
>   $pizzaName->addFilter(new Zend_Filter_Alpha())
> this error does not occur.
> 
> Can anybody reproduce this error? Is this a bug? Or is my system
> configured badly?
> 
> Thanks for advice.
> 
> Best regards,
> 
> Ralf
> 

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to