0

My Yii app url format is domain/controller/function. I don't want to disclose the original controller name and function to user.The user should see only domain/foo/bar instead of original names.How can I achieve it?

2 Answers 2

4

You can archive it by using url manager. Imagine you have a controller called "SampleController" with an action called "actionSampless", then you can have something like this:

'urlManager'=>array(
    'urlFormat'=>'path','showScriptName'=>false, 'caseSensitive'=>false,
    'rules'=>array(
    'test/test/*'=>'Sample/Sampless',
     //'pattern1'=>'route1', (it goes like this)
   ),
  ),

for more info click here. read User-friendly URLs topic..

Hope it will help you.

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

Comments

0

inside the application configuration i.e in config/main.php

add the line to url rules

'foo/bar'=>'ur_controller_name/ur_action_name',

Comments

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.