0
votes

I want to map my controller to the urlManager with enablePrettyUrl=true.

When name of the class is Ts4Controller, it maps very well with

'https://' . $configDomain['siteMainDomainName'] . '/ts4'=> 'ts4/index',

But when I change controllers name to TheSims4Controller and

'https://' . $configDomain['siteMainDomainName'] . '/ts4'=> 'thesims4/index',

it doesn't works and it will get 404 error.

Is there some requirements for controller names in Yii 2.0?

Thank you very much!

1

1 Answers

5
votes

By default, when using camel cased controllers as the route, the name should be all lowercase with the words separated by hyphens. So your code becomes:

'https://' . $configDomain['siteMainDomainName'] . '/ts4'=> 'the-sims4/index',