Wiki

Sorted by commentsX
Displaying 321-330 of 733 result(s).

Directory independent extensions

Created 4 years ago by GOshaTips3 comments – viewed 9,172 times – ( +16 / -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 8,424 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.

Upload files in Yii2 with MongoDb and GridFs

Created about a year ago by edoardo849How-tos3 comments – viewed 9,473 times – ( +8 ) – version 2.0
Uploading files in a webapp can be extremely tricky and sometimes the quickest way to do it is to store the file directly in the webserver or into a DNS (like Amazon S3) and then to save the link and the metadata inside a table in the DB. The thing is that you'll have to deal with file permissions, server storage, file management and so on (which is perfectly fine, by the way).

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

Created 4 years ago by Steve FriedlFAQs3 comments – viewed 46,595 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 4 years ago by imeheszTips3 comments – viewed 13,337 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 4 years ago by Steve FriedlHow-tos3 comments – viewed 68,349 times – ( +11 ) – 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 4 years ago by Steve FriedlHow-tos3 comments – viewed 17,578 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 4 years ago by Igor IvanovicTutorials3 comments – viewed 44,819 times – ( +9 / -1 ) – version 1.1
...folder /protected/components/UserLoginWidget.php... ...extending the CWidget class...
tags: user, login, modal, widget

Real Time Logging

Created 4 years ago by lucifuriousTips3 comments – viewed 20,481 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 4 years ago by Paul ApostolHow-tos3 comments – viewed 20,450 times – ( +12 ) – version 1.1
Install a Wordpress site (mine is in "http://localhost/test/wordpress")