In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the common invocation skills of Yii programming development. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.
1. Set up the cookie:
$cookie = new CHttpCookie ('mycookie','this is mycookie'); $cookie- > expire = time () + 60 days, 60 days, 24 days, 30 days Yii::app ()-> request- > cookies [' mycookie'] = $cookie
two。 Read cookie:
$cookie = Yii::app ()-> request- > getCookies (); echo $cookie ['mycookie']-> value
3. Destroy cookie:
$cookie = Yii::app ()-> request- > getCookies (); unset ($cookie [$name])
4. Get updated data id
$post- > save (); $id = $post- > attributes ['id']
5. Get the inserted data id
$id = Yii::app ()-> db- > getLastInsertID ()
6. Get the data from get,post
Yii::app ()-> request- > getParam ('id')
7. Get the ip address
Yii::app ()-> request- > userHostAddress
8. Get the url of the previous page to return
Yii::app ()-> request- > urlReferrer
9. Get the current url:
Yii::app ()-> request- > url
10. Get the current home url:
Yii::app ()-> homeUrl
11. Get the current return url:
Yii::app ()-> user- > returnUrl
twelve。 Project path:
Dirname (Yii::app ()-> BasePath)
13. Project catalog:
Yii::app ()-> request- > baseUrl
14. Get the ID method of the current controller in view:
Yii::app ()-> request- > baseUrl
15. Get the ID method of the current action in view:
Yii::app ()-> getController ()-> getAction ()-> id
16. Yii determines the submission method:
Yii::app ()-> request- > isPostRequest
17. Get the current domain name:
Yii::app ()-> request- > hostInfo
18. Get the physical path to the proteced directory:
YII::app ()-> basePath; is all the contents of this article entitled "what are the common invocation techniques in Yii programming development?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.