yii - Disabling a controller page from being viewed -
i absolute newbie in world of yii , mvc. question : if have made crud of model , have modified "_form.php" partial used place else, example comment form used "post" view, , example if link creation of comment :
http://localhost/example/comment/create
how stop page being accessed , called view of "posts" page only?
would have use rbac this? there other method? using "get" methods maybe?
you can try checking if referrer page 1 want, using geturlreferrer()
or magic property urlreferrer
:
http://www.yiiframework.com/doc/api/1.1/chttprequest#geturlreferrer-detail
e.g.:
if(preg_match('/post\/view/', yii::app()->request->urlreferrer) === 1) { // }
place in comment/create
action.
Comments
Post a Comment