Disable plugin per page

Hi folks,

I would like to disable (or enable) a plugin on certain pages but I seem to miss something here, as I don’t see the right approach. Like so:

'routes' => [
      'pattern' => '(de|en)/path/to/mypage',
      'action'  => function () {
        return [
          'the.plugin' => [
            'enabled' => false

But this doesn’t work and I’m now at the point of banging my head against some wall.
Can anyone of you kind ppl help me out here?

Plugins are loaded automatically.

What exactly do you want to achieve? I’m not really shore what you are trying to do in your route? Trying to set a config option? Is that your own plugin? Then you can use config options.

Yes, I know they are loaded automatically, and that’s what’s interfering.

Following situation:
I need a space within the content, where external plugins can be switched off as they interfere with the content / output therein. My own I can accordingly alter but this is not the case with others. So I thought about the possibility to disable these for one or various pages and its children.

You probably would have to overwrite the plugins registry in the config for certain conditions, but I’m not really sure how this is done.

Ok thx @texnixe, I’ll keep on looking out for a solution. If I happen to come across one I’ll let you know.

In any case that’s not something you can achieve via a route.

How about the ready option?