Search code examples
perlcatalyst

How do I load Catalyst::Plugin::SmartURI in my main application file?


I'm working on some large Catalyst codebase which doesn't have a seperate config file. However, in the main module it does have things like:

__PACKAGE__->config(
    name => 'Example::Server',
    encoding => 'UTF-8',
    ...
);

So I was hoping I could just add the SmartURI config there, like this:

__PACKAGE__->config(
    name => 'Example::Server',
    encoding => 'UTF-8',
    'Plugin::SmartURI' => { 'disposition' => 'hostless' },
);

But it looks like that's not enough to load or enable it.

So, I'm obviously missing something, any help appreciated.

ps. The plugin + deps have been installed through CPAN.


Solution

  • Answering my own question here, as I discovered the answer through other means.

    To load the plugin, it needs to be passed to 'use Catalyst', or alternatively in the call to MyApp->setup ().