Wiki

Sorted by commentsX
Displaying 101-110 of 777 result(s).

How to automate timestamps in ActiveRecord models

Created 7 years ago by dalipTutorials9 comments – viewed 140,169 times – ( +32 ) – version 1.1
There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here:

Using counters with ActiveRecord

Created 4 years ago by davi_alexandreTips9 comments – viewed 27,506 times – ( +14 / -1 ) – version 1.1
Let's say, for example, that you are developing a blog or some kind of CMS and you want to track the number of times each post was viewed (maybe to show a list of the most viewed ones).

Exporting CGridView results to CSV file

Created 4 years ago by RusAlexTutorials9 comments – viewed 43,362 times – ( +6 / -3 ) – version 1.1
A few days ago, i worked for CGridView exporting functional for my client. He asked me to create a simple exporting to a CSV file a CGridView search results.
tags: cgridview, export, csv

Creating a database-driven hierarchical Structure combined with CMenu and superfish

Created 6 years ago by thyseusTutorials9 comments – viewed 47,460 times – ( +15 ) – version 1.1
Note: Please also take a look at the newer EMenu extension. This works even better that the deprecated CDropDownMenu!
tags: menu

Events explained

Created 4 years ago by pligorTutorials9 comments – viewed 35,335 times – ( +22 / -3 ) – version 1.1
Let's see what exactly are the events in Yii!

Caching strategy

Created 2 years ago by darkheirHow-tos9 comments – viewed 6,276 times – ( +5 / -1 ) – version 1.1
Note: Before reading this wiki you should have read the caching part in the Yii guide
tags: caching, filter

A Multi-Tenant Strategy using Yii and MySQL

Created 2 years ago by JFReyesHow-tos9 comments – viewed 20,395 times – ( +10 ) – version 1.1
This article describes an implementation of multi-tenancy using Yii and MySQL.

Update CGridview row separately using ajax request

Created 2 years ago by Kostas Apazidis (KonApaz)How-tos9 comments – viewed 13,542 times – ( +7 ) – version 1.1
There are cases you want to update a record on CGridview directly

A simple action for CJuiAutoComplete

Created 5 years ago by tydeas_drTips9 comments – viewed 36,595 times – ( +17 / -1 ) – version 1.1
More or less I use auto-complete field for a form. CJuiAutoComplete is a yii widget for this purposes. The common use case is to make an ajax request and retrieve a list from the database. So in this case you have to write a controller action to return you a json encoded list. What if I had a generic action to do this work for me?

Relations: BELONGS_TO versus HAS_ONE

Created 5 years ago by Steve FriedlFAQs9 comments – viewed 115,095 times – ( +69 ) – version 1.1
It's very common to see new Yii users confusing the relations HAS_ONE and BELONGS_TO, and getting it wrong means you won't get proper values back. And though we'll talk about HAS_MANY as well, we're specifically omitting the MANY_MANY relation because it's a whole different animal.