konapaz
(Konapaz)
July 2, 2013, 10:36am
1
Hi,
How to hide (rename) the controller from url and models from post method ?
I don’t want use urlManger rules
There are similar post using controllerMap but I have problem with views on modules
http://www.yiiframework.com/forum/index.php/topic/18764-lower-case-url/page__p__92323#entry92323
I want url for specific controller seems
facecontrollerName/fakeActionName
and all post forms FakeNameModel[an_attribute]
I don’t want users knows my controller and action or model names!
what is the best practice?
Many thanks!
i do it only by using url manager, it is comfortable and easy for Yii developers.
konapaz
(Konapaz)
July 2, 2013, 11:01am
3
celin thanks for your reply
but the urlmanager is for other purposes (for example SEO)
it doesn’t hide anything but only rewrite the urls
any other suggestion?
menxaca
(Menxaca)
July 3, 2013, 7:51am
4
Well… you can "hide" in some way using UrlManager.
Imaging we have a controller called "DonationController" with an action called "actionDonate", then you can have something like this:
'urlManager'=>array(
'urlFormat'=>'path','showScriptName'=>false, 'caseSensitive'=>false,
'rules'=>array(
'send/money/*'=>'donation/donate',
),
),
I didn’t have the chance to use controllerMap yet, sorry.
konapaz
(Konapaz)
July 3, 2013, 11:10pm
5
menxaca:
Well… you can "hide" in some way using UrlManager.
Imaging we have a controller called "DonationController" with an action called "actionDonate", then you can have something like this:
'urlManager'=>array(
'urlFormat'=>'path','showScriptName'=>false, 'caseSensitive'=>false,
'rules'=>array(
'send/money/*'=>'donation/donate',
),
),
I didn’t have the chance to use controllerMap yet, sorry.
Hi metaxa, thank you for your response
As I said in the beginning “I don’t want use urlManager rules” at least for this purpose.
Also urlManager doesn’t hide or rename the input fields name of a post form so the name of the models file are exposed
May the only way to do that (at least for the models) is to extend all models by another empty class and use the lastest by the controllers and viewers