Wiki

Sorted by commentsX
Displaying 291-300 of 687 result(s).

Simple Web APIs for your Yii App

Created 7 months ago by shivHow-tos3 comments – viewed 6,042 times – ( +2 / -2 ) – version 1.1
Its very common now-a-days to have Mobile app for web apps. For Mobile apps we need web APIs to fetch data or even post/update on web. We found a very simple method to make such interface. Mobile App can call plain get or post request and receive data back in JSON format. JSON is relatively easy for mobile app to handle while plain standard GET/POST request for easy for Web server to handle. This mixed approach saves lot of time on server side. We not really need to handle actual REST requests and still be able to exchange data between web and mobiles or ajax java-scripts or even node.js.
tags: API, JSON

Directory independent extensions

Created 3 years ago by GOshaTips3 comments – viewed 8,389 times – ( +15 / -1 ) – version 1.1
Many people want to use downloaded extensions in their own way. As for me most of the extensions require me to correct Yii::import() instructions inside their source code. All these extensions are directory dependent. To avoid the situation described above, I suggest to implement pseudo-anonymous aliases:

Using sub query for doubletts

Created 2 years ago by mbTips3 comments – viewed 6,872 times – ( +1 ) – version 1.1
find doubletts by db fields. in this example i will check doublets for 3 tabelfields (col1,col2,col3). so i will get a subquery with the condition, select and grouping of the tablefields. the having with COUNT() > 1 means: find all records more then one result.

"Why do I get a 403 error when trying to use Gii?"

Created 3 years ago by Steve FriedlFAQs3 comments – viewed 41,084 times – ( +7 ) – version 1.1
After enabling the Gii module in your protected/config/main.php file and then try to use it with http://example.com/index.php?r=gii, you get an error:
tags: Gii, config

Auto TDD - How to auto-run PHPUnit

Created 3 years ago by imeheszTips3 comments – viewed 12,286 times – ( +3 / -1 ) – version 1.1
If you are lucky enough and have the privilege to develop on a Linux based environment, this little tip might boost-up your TDD process (at least the Unit Testing part). Please note, that this should work just fine with Apple computers also, but not tested!
tags: PHPUnit, testing, TDD

Setting and getting systemwide static parameters

Created 3 years ago by Steve FriedlHow-tos3 comments – viewed 56,657 times – ( +10 ) – version 1.1
Occasionally one wishes to set systemwide parameters for an application, such as a contact address for email, an application name, or setting an option that guides major behavior. Yii provides for setting of static parameters in the configuration file, and this article talks about how to do it conveniently.
tags: config

Enforcing "You must agree" requirements in forms

Created 3 years ago by Steve FriedlHow-tos3 comments – viewed 15,577 times – ( +29 ) – version 1.1
Checkboxes have two possible values, true and false, but some applications require that the user select one particular value before proceeding. Examples might be:
tags: validation

How to create nice modal login widget with a CJuiDialog

Created 3 years ago by Igor IvanovicTutorials3 comments – viewed 41,528 times – ( +9 ) – version 1.1
...folder /protected/components/UserLoginWidget.php... ...extending the CWidget class...
tags: user, login, modal, widget

Real Time Logging

Created 3 years ago by lucifuriousTips3 comments – viewed 18,588 times – ( +14 ) – version 1.1
I've seen a lot of people asking about the logging facilities in Yii and thought I'd share a nice little class I wrote that provides near real-time logging.

Run an Yii Application inside an Wordpress page

Created 3 years ago by Paul ApostolHow-tos3 comments – viewed 18,254 times – ( +12 ) – version 1.1
Install a Wordpress site (mine is in "http://localhost/test/wordpress")