How to use my own implementation of PresenterFactory?

czm4rty
Member | 29
+
0
-

Hi, I would like to use my PresenterFactory, but I don't know where should I tell the application to use my own. I have found some definitions in NetteExtension class but I don't want to override 100 another classes. Is there some easier way to use own implementation of this class?

nanuqcz
Member | 844
+
+1
-

Hello,
just write it to the config.neon like this:

parameters:
    ...

nette:
    ...

services:
    nette.presenterFactory:
        class: YourPresenterFactoryClass()

Comments

czm4rty:

I had to add param %baseDir and now it works like a charm. Thanks!

5 years ago
nanuqcz:

In stable version, yes. In dev-master (so propably since Nette 2.3), PresenterFactory's constructor doesn't have this parameter: https://github.com/…80f9e694f4df. You are welcome :-)

5 years ago