Writing a plugin and creating some links. Trying to use:

$url = craft::$app->urlManager->createUrl(['', 'state' => 'KS']);

to create a URL. I am expecting:


but get:


That results in the following error:

HTTP 404 – Not Found – yii\web\NotFoundHttpException Template not found: actions

What is the p=actions that is being added to the url? I am a bit confused by this.

1 Answer 1


craft::$app->urlManager->createUrl will always return an action url because in the end this function does return UrlHelper::actionUrl($route, $params);

You want to create a basic site url so you need to do

UrlHelper::url('', ['state' => 'KR'] )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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