Plugin routing casing: camel, lower, Pascal Recently got tripped up with plugin routing due to casing.

It seems when you're in the control panel, your "plugin handle" is lower-cased in routes, though both seem to work: /cp/settings/plugins/myplugin (/cp/settings/plugins/myPlugin` also works)

However, when using an controller action, it seems like it must be camel cased (/actions/myPlugin/foo).

Seems inconsistent, unless I'm missing some reasoning.

The docs say [PluginHandle]/[ControllerName]/[ActionName], but it seems like it's actually [pluginHandle]/[controllerName]/[actionName] as the example shows (cocktailRecipes/ingredients/saveIngredient).
This is the general rule of thumb...


Lower (myplugin) - When creating links for the browser to follow ("href" &amp; "src")
Camel (myPlugin) - When creating a path for PHP to interpret (like calling an action)
Pascal (MyPlugin) - Almost never. Only for naming plugin components. (ie: MyPluginService)


Here's the logic behind lower vs. camel... If it's an "href" or "src" for your browser to follow, you're basically referring to the folder name which contains your plugin. If it's a reference for PHP to interpret, that information is used to trigger a part of your plugin by class name.

In the case of a controller action (/actions/myPlugin/foo), that path starts as a normal browser path, until actions gets interpreted by your root index.php file. Once the index file parses out the actionTrigger, the rest of the path is handled via PHP.