dudapiotr / ZfTable

*Not supported*ZfTable 3.1. Awesome ZF2 table / grid (and much much more) generator with huge possibilities of decorating and conditioning. Integrated with DataTables, Doctrine 2, Bootstrap 2.0 and 3.0.
http://dudapiotrek.laohost.net/
MIT License
75 stars 59 forks source link

Is there a way to create and add my own Decorator Classes? #85

Closed fagundes closed 8 years ago

fagundes commented 8 years ago

I'm new with ZfTable. I was reading the code and documentation but I couldn't find a way to add my own decorators classes.

I guess that It will need some changes on DecoratorFactory and Module::onBootstrap to anyone be able to add on their own modules (Module.php or config files) to inject in DecoratorPluginManager more decorators. Am I right?

W33k3nd commented 8 years ago

I added some decorators in my Module.php to get \ZfTable\Decorator\DecoratorFactory::getPluginManager();. Now use setInvokableClass to add our own Decoration.

I hope this can help you.

fagundes commented 8 years ago

Thank you! It should work!

However, it's not the standard way, I mean it's not like others zf2 service managers. But I suppose it's the only way for now.

fagundes commented 8 years ago

Decorators which depends of others services won't work. For instance, a Link Decorator that depends of BasePath Helper. In other words, I can't register a Factory for Decorator.