Hi Daniel,

Daniel Gimenes schrieb am 03.05.2013 18:09:
> If you use InputFilterManager to construct your InputFilter, then 
> InputFilterManager will inject FilterManager and ValidatorManager in 
> your chains.
> See 
> https://github.com/zendframework/zf2/blob/master/library/Zend/InputFilter/InputFilterPluginManager.php#L63-64

I noticed that and got an example working.

But normally I have a inputfilter class which extends the basic
Zend\InputFilter\InputFilter and uses the __construct() method to build
up all the input elements. I like this approach for easy IDE code
completion and stuff like that.

----------------------------------------------------------------------
namespace Pizza\InputFilter;

use Zend\InputFilter\InputFilter;

class PizzaInputFilter extends InputFilter
{
    public function __construct()
    {
        // here all filters and validators are defined
    }
}
----------------------------------------------------------------------

With this approach I have no direct access to the InputFilterManager and
therefore cannot use all nicely configured custom filters and
validators. Passing the factory of the registered "inputfilter" of the
InputFilterManager to the constructor feels a little awkward.

Any idea?

Regards,

Ralf

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to