This looks like it’d be in a closure registered on the UrlManager::EVENT_REGISTER_CP_URL_RULES
event, like this:
Event::on(
UrlManager::class,
UrlManager::EVENT_REGISTER_CP_URL_RULES,
function (RegisterUrlRulesEvent $e) {
$e->rules['my/route'] => 'module/controller/action';
});
The above explains it almost in context—when creating a route with a plain string, it's interpreted as:
<module-id>/<controller-name>/<action-name>
The "Module ID" is either defined by the Plugin in question, or when you declare modules in app.php
:
<?php
return [
'*' => [
// Lots of other irrelevant (but important) stuff redacted, here!
'modules' => [
'bizniz' => \modules\mymodule\BusinessStuff::class,
],
],
];
If you had a Controller in your Module (and have properly declared BusinessStuff::$controllerNamespace
) that looked like this…
<?php
namespace modules\mymodule\controllers;
use craft\base\Controller;
class FinanceController extends Controller
{
public function actionCountBeans()
{
return $this->asJson(['profit' => (rand() / getrandmax()) * 1000000]);
}
}
…your "action path" would be bizniz/finance/count-beans
. Yii takes care of mapping the path to your controller—and the UrlManager
ensures the key you assign it to acts as an alias.