Plugin name is uppercase abbreviation, assets get inflected to underscore

Hi everyone

My plugin name is an abbreviation, say FOO. It is set in src/FOOPlugin.php inside $name property and seems to work.

When I do $this->Html->css(['FOO.stylesheet']) inside a template, I get /f_o_o/stylesheet.css as the URL, because in vendor/cakephp/cakephp/src/Routing/Asset.php:34 it has protected static string $inflectionType = 'underscore'; by default.

How do I change this on a specific plugin level to inflection type camelize, so that the URLs I get are /FOO/stylesheet.css instead?

Checked book.cakephp.org/5/en/core-libraries/plugin.html and github.com/cakephp/cakephp/blob/5.x/src/Core/BasePlugin.php for a possible configuration.

I’m on CakePHP 5, but this could be any version.

Thanks for reading!

You can, as you can see in the code, call this static mehod. E.g. from bootstrap:

But: That’s a convention in the framework itself, and will also have impact throughout. So even if you change this (which you can), it will also have similar issues in other places.

Simple solution: DO NOT do that.
Use proper Foo for the name itself (like class names) and thus FooPlugin and all works perfectly fine, also across the rest of the app.
As per Coding Standards - 5.x