0

Can anyone point me in the right direction in order to write a URL rule in order to achieve the following: Using the base controller I want to get to each of the parameters in this url: DomainName/clientID/fileID

2 Answers 2

1

Haven't tested it, but this should work:

'rules' => array(
  '<clientID:\d+>/<fileID:\d+>' => 'myBaseController/myAction',
)

Just make sure the one rule gets added before your Yii default URL rules. FYI, the rule assumes that both client ID and file ID are integers. If fileID contains letters, change it to fileID:\w+.

Sign up to request clarification or add additional context in comments.

Comments

0
$url = $this->createUrl('timeSheetDetaile/create',array('timesheetID'=>$timeSheedID,'dayID'=>1));

first param is the name of your controller and second array is $_GET params .. have fun.

4 Comments

But isn't that to create a URL to go to that action? I'm trying to figure out how to set the urlManager rules in the main config to allow for two nested parameters that direct to the defaultController without mentioning the controller name in the URL. Because people will be given these URL's from outside the system.
dont worry about URL will be build
the domain name wont be in URL .. you wnat your domain name before controller ??
Yeah, I'm aiming for domain/parameter/parameter[then standard post vars]. Without the controller name or action being in the URL

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.