Urlmanager static parameter for action


(ffurbo) #1

I have optional parameter in my action like this:

public function actionFileSlug($slug, $download = 0)

I would like to achieve something like below:

'media/file/<slug:[\w\-\.]+>' => 'media/file-slug', 
'media/file/download/<slug:[\w\-\.]+>' => ['media/file-slug', 'download' => 1],

Second rule does not work of course.

Is there any way I could pass static parameter to action?
I know I could workaround this by creating separate action or simply make my parameter dynamic, but I wonder if there is better solution.