Hi, I used Gii to create a model, controller and CRUD views from a MySQL table user_type.
The view folder Gii created is named views\user-type.
Everything appears to work ok for example: yii2basictest/web/index.php?r=user-type/index
However, if someone inadvertently uses the url with the dash ‘-’ missing from user-type e.g : yii2basictest/web/index.php?r=usertype/index
then I get the error: Invalid Parameter – yii\base\InvalidParamException
The view file does not exist: /Applications/XAMPP/xamppfiles/htdocs/yii2basictest/views/usertype/index.php
I was expecting the page to fail gracefully with a Not Found 404
Is this the expected behavior, to throw an error?
What is the best way to deal with these urls that don’t exists:
change folders names?
catch the errors?
set an apache rule?
don’t use two-word table names?
Tested using Yii2 basic template on Mac OS Apache/2.4.9 (Unix) PHP/5.5.11
Thanks for any help.