Add pageMethods to config.php


I have the following plugin:

Kirby::plugin('mymy/methods', [
  'pageMethods' => [
    'mediaFiles' => function () {
      $media = site()->files();
      return $media->add($this->files());

Is it possible to add pageMethods directly to config.php instead of using a plugin? When I do it it no longer works :thinking:

No, that’s not possible. You can define hooks and routes in config and config settings, but not plugins.

1 Like

Ok thanks!