0

The error I'm getting:

HTTP 404 – Not Found – yii\web\NotFoundHttpException
Page not found.
↵
Caused by: Invalid Route – yii\base\InvalidRouteException
Unable to resolve the request "Expedweather/forecast-panel".

The plugin's base was made through https://pluginfactory.io, I've simply added to it.

Below are the relevant code excerpts which for some reason do not seem to work as intended.

// ./src/Expedweather.php::init
$map_page = 'data\/<range:\w+>\/<peak:\w+>\/<view:\w+>\/<parameter:\w+>';
$event->rules[$map_page] = 'expedweather/forecast-panel';
// ./src/controllers/DefaultController
protected $allowAnonymous = ['index', 'forecast-panel'];
public function actionForecastPanel() {...}

Any ideas and/or potential solutions? The Regex routing seems to work fine, but it cannot find the DefaultController's Action.

This is on CraftCMS Version 3.3.0.1

0

Found a Solution

Context:

When I created my plugin-frame through https://pluginfactory.io the DefaultController was still a thing -> routing to /pluginname/default-controller-action-name worked as it defaulted to search in the... default-controller. But it seems that is no more,
so what I had to do instead to get it to find the action is add a section referring to the controller.

this is the new/fixed code:

// ./src/Expedweather.php::init
$map_page = 'data\/<range:\w+>\/<peak:\w+>\/<view:\w+>\/<parameter:\w+>';
$event->rules[$map_page] = 'expedweather/default/forecast-panel'; // <-- changed!!
// ./src/controllers/DefaultController
protected $allowAnonymous = ['index', 'forecast-panel'];
public function actionForecastPanel() {...}

The only row that changed is the $event->rules one which now has /default/ before the action -> this refers to the DefaultController.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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