I've this Url "backend/codici/view?id=1" and I want to hide the id, because I don't want to show it. It must be only "backend/codici". I try enabling Pretty Url but it doesn't work. This my config/web.php file:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [],
],
What I have to do to solve it? thank you very much!!!!
Scenario 1
Is there just one record of type
codici? If yes, replace theCodiciController::actionIndex()method in order to instead of listing allcodicirecords, load the one (Codici::findOne()) and renderviewfile instead ofindex. Basically copy paste the content ofactionView()but instead of load model by id, load the existing one.I'm assuming default code generated by Gii for a
codicitable in your database.Scenario 2
If there is more than one record, then you have 2 options: