createUrl adding p=actions Writing a plugin and creating some links. Trying to use:

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


to create a URL. I am expecting:


  http://test.com/index.php?state=KS


but get:


  http://test.com/index.php?p=actions&amp;state=KS


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.
craft::$app-&gt;urlManager-&gt;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' =&gt; 'KR'] )