Camelcase action and urlManager rules

So, I’m a bit confused on how to handle camelcase actions like “actionCreateForm”. If we assume that the controller is “test”, then is the proper route “test/create-form”? If that is the case, then what are the proper urlManager rules to catch this? Here is what I currently have, but it’s not working (it’s in a module called “appMain”):


'<controller:\w+>/<action:\w+>'=>'appMain/<controller>/<action>',

This seems like it should be easy to handle, but I can’t figure out what I’m doing wrong. If I only use a single word as the action it works fine, so everything else seems to be setup correctly. How do all of you handle camelcase actions?

Thanks!

“\w” matches [_a-zA-Z0-9], i.e., under score, alphabets(upper and lower), and digits. It doesn’t include “-”.

Try this:




'<controller:[\w-]+>/<action:[\w-]+>'=>'appMain/<controller>/<action>',



1 Like

Thank you! That solved my problem.