I'm looking to have a basic index page for my plugin, yet I can't seem to get index.html working for my plugin. But when I head to site.local/admin/plugin it displays 404 Template Not Found

I have the folders set up like so: plugin/templates/index.html

I've read here that CP templates automatically get set up for this folder so there's no need to define routes for it.

Plugins get a Control Panel template root added automatically, named after the plugin handle, which points to the templates/ folder within the plugin’s base source folder.

Am I missing something here?


did you register the routes in your plugin's init() ?

  • ``` // Register a custom CP route Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, function(RegisterUrlRulesEvent $e) { $e->rules['/'] = ['template' => 'putter/index']; });```
    – JMKelley
    May 26 '19 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.