Articles in category "how-tos", sorted by viewsX
Displaying 151-160 of 348 result(s).


Created 2 years ago by Gerhard LiebenbergHow-tos4 comments – viewed 17,413 times – ( +5 / -1 ) – version 1.1
This example includes a composite condition as well as an empty condition - as if you bypass or disable defaultScope without using resetScope().

pass variables or content block from view file to layout file

Created 3 years ago by yiqing95How-tos0 comments – viewed 17,248 times – ( +2 ) – version 1.1
If you use yiic to generate webApplication there will be a layout folder under the protected/views/, and the Controller class under protected/components which will use by default these layouts files.

Displaying uploaded file from DB for update with FileInput widget

Created about a year ago by Kartik VHow-tos3 comments – viewed 17,232 times – ( +39 / -5 ) – version 2.0
This is for folks who are using \kartik\widgets\FileInput to upload files from your client. How do you display an image for update after you have uploaded it to the server using the widget?

multiple CActiveDataProviders in one CGridView

Created 2 years ago by Kostas Apazidis (KonApaz)How-tos6 comments – viewed 16,884 times – ( +7 / -1 ) – version 1.1
There is a few cases that you want more of one CActiveDataProvider displayed in one CGrideView How to do that?

A Multi-Tenant Strategy using Yii and MySQL

Created about a year ago by JFReyesHow-tos8 comments – viewed 16,793 times – ( +10 ) – version 1.1
This article describes an implementation of multi-tenancy using Yii and MySQL.

Using updateAll and deleteAll with scopes

Created about a year ago by le_topHow-tos4 comments – viewed 16,780 times – ( +5 ) – version 1.1
Using CActiveRecord->updateAll() and CActiveRecord->deleteAll() with scopes and criteria requires some tricks that are explained in this article. While findAll() , find() and some other methods use scopes automatically, updateAll() and deleteAll() do not.

How to create a Widget - Recent Comments widget

Created about a year ago by Nisanth thulasiHow-tos3 comments – viewed 16,693 times – ( +8 ) – version all
Here's a simple way to create a Recent comments showing widget to be used in your templates. The idea is just to highlighting your blog's new comments.

Popup AJAX DialogBox without any extension

Created 2 years ago by Kostas Apazidis (KonApaz)How-tos6 comments – viewed 16,658 times – ( +8 / -1 )
In this wiki I explain how to show a default popup dialogbox (like Gii does) using an existing module.

Cheat Sheet: Displaying Name instead of Numbers and Displaying Alphanumeric instead of numeric values

Created 3 years ago by skwordenHow-tos4 comments – viewed 16,451 times – ( +4 / -1 ) – version 1.1
I keep a reference to some simple but painful task if you forget a common or something. I am new to Yii and this took awhile for me to figure out. Everything I read said do this or do that and not a single one worked for me. However, the following did.

i18n All-in-one format and timezone conversions for date, time, timestamp and datetime.

Created 2 years ago by Gerhard LiebenbergHow-tos3 comments – viewed 16,395 times – ( +8 / -1 ) – version 1.1
Countries sometimes change their laws pertaining to timezones and daylight saving times. This means that GMT+2 can be a different time this August compared to last August! However, by using php's DateTime class (instead of timestamps), we can do both "format" and "timezone" conversions on a single DateTime object (only 2 lines of code) for date, time, timestamp and datetime types - while php takes care of nightmares such as current and historical timezones and daylight saving times.