Current page: yii: APP ()-> request-> URL;
Jump to the previous page: $ this-> redirect (yii: APP ()-> request-> urlreferrer );
Root directory URL: yii: APP ()-> baseurl or yii: APP ()-> request-> baseurl;
Custom URL: $ this-> createurl ('Post/read', array ('id' => 100) or yii: APP ()-> createurl ();
If the browser is relocated to the logon page and the logon succeeds, we will relocate the browser to the page that causes verification failure. How do we know this value? We can use the returnurl attribute of the user part.
Therefore, we can use the following to execute redirection:
Yii: APP ()-> request-> redirect (yii: APP ()-> User-> returnurl );
Current Domain Name: yii: APP ()-> request-> hostinfo;
Except the Domain Name: yii: APP ()-> request-> geturl ();
Homepage Address except Domain Name: yii: APP ()-> User-> returnurl;
Root directory address except Domain Name: yii: APP ()-> homeurl;
Yii: APP ()-> request-> userhostaddress;
Yii judgment submission method: yii: APP ()-> request-ispostrequest;
The physical path of the proteced Directory: yii: APP ()-> basepath;
Get the URL of the previous page to return: yii: APP ()-> request-> urlreferrer;
Obtain the current controller ID: yii: APP ()-> getcontroller ()-> getaction ()-> ID;
Project path: dirname (yii: APP ()-> basepath );
Yii obtains get and post data: yii: APP ()-> request-> getparam ('id ');
How to set the time zone for yii:
You can set the time zone in 'timezone '=> 'Asia/chongqing' in config/Main. php.
How does yii make the Form Verification prompt Chinese:
Add language => 'zh _ Cn 'to the app configuration in Main. php. The system prompts Chinese by default.
Prevent repeated submission: ccontroler-> refresh ();