Re: [fw-general] Problem with Zend_Form and filters (ZF 1.6.2)

2008-10-20 Thread Ralf Eggert
Hi Matthew,

Matthew Weier O'Phinney schrieb am 20.10.2008 21:17:
> Yes, please -- I should have removed those examples for the 1.6.0
> release. Originally, we allowed it, but it was too difficult to support
> alongside lazy-loading (which was necessary to implement both for
> maintainability and performance).

Done: http://framework.zend.com/issues/browse/ZF-4651

Best regards,

Ralf


Re: [fw-general] Problem with Zend_Form and filters (ZF 1.6.2)

2008-10-20 Thread Matthew Weier O'Phinney
-- Ralf Eggert <[EMAIL PROTECTED]> wrote
(on Monday, 20 October 2008, 08:20 PM +0200):
> Hi Matthew,
> 
> > 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.
> 
> Thanks for the quick response and the clarification. I think the manual
> should be corrected then. That was the place I got the example from in
> the first place.
> 
> http://framework.zend.com/manual/en/zend.form.elements.html#zend.form.elements.filters
> 
> Should I create an issue for this?

Yes, please -- I should have removed those examples for the 1.6.0
release. Originally, we allowed it, but it was too difficult to support
alongside lazy-loading (which was necessary to implement both for
maintainability and performance).

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


Re: [fw-general] Problem with Zend_Form and filters (ZF 1.6.2)

2008-10-20 Thread Ralf Eggert
Hi Matthew,

> 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.

Thanks for the quick response and the clarification. I think the manual
should be corrected then. That was the place I got the example from in
the first place.

http://framework.zend.com/manual/en/zend.form.elements.html#zend.form.elements.filters

Should I create an issue for this?

Best regards,

Ralf


Re: [fw-general] Problem with Zend_Form and filters (ZF 1.6.2)

2008-10-20 Thread Matthew Weier O'Phinney
-- 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/


[fw-general] Problem with Zend_Form and filters (ZF 1.6.2)

2008-10-20 Thread Ralf Eggert
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');
  }
  }
-

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