Sorted by ratingX
Displaying 101-110 of 779 result(s).

How to log changes of ActiveRecords?

Created 7 years ago by pfthTutorials7 comments – viewed 45,009 times – ( +41 / -2 ) – version 1.1
A simple and effective way to keep track what your users are doing within your application is to log their activities related to database modifications. You can log whenever a record was inserted, changed or deleted, and also when and by which user this was done. For a CActiveRecord Model you could use a behavior for this purpose. This way you will be able to add log functionality to ActiveRecords very easily.
tags: Logging

Common Yii questions

Created 5 years ago by dckurushinFAQs2 comments – viewed 39,958 times – ( +21 ) – version 1.1
Here I suggest to list the most common questions you meet in the forum or freenode irc. Feel free to edit this wiki article, and add another question with answer

The Comedy of Errors

Created 4 years ago by fsbOthers3 comments – viewed 9,601 times – ( +21 ) – version 1.1
Please join the party by adding your own favorite Yii programming errors. Be sure to leave at least a hint at the correction.

Using Yii with PHP 5.4 built-in webserver instead of Apache

Created 4 years ago by samdarkHow-tos1 comment – viewed 12,597 times – ( +21 ) – version 1.1
Since version 5.4 PHP can work as a simple webserver so you can develop Yii applications without installing Apache. That's how to use it:

Display an AJAX tree from your DB using CTreeView

Created 6 years ago by Fran├žois GannazTutorials10 comments – viewed 55,468 times – ( +21 ) – version 1.1
This example uses a MySQL DB with a table named tree with the fields id, name, and parent_id. The parent_id will be NULL for root elements. The SQL is kept simple (no autoinc, no FK, etc).
tags: AJAX, CTreeView

Reading the doc

Created 6 years ago by zaccariaTips0 comments – viewed 7,728 times – ( +21 ) – version 1.1
Almost all the information you need whilst working with yii is written in the Class Reference.
tags: doc

Dynamic Sidebar using CClipWidget

Created 5 years ago by SheldmanduHow-tos5 comments – viewed 26,779 times – ( +21 ) – version 1.1
Most applications will have one or two sidebars and often you want to control the content that should appear in the sidebar based on the action. For example you will want to show something different on the homepage as opposed to some view page. While achieving this you generally also want to avoid putting the layout into each view, as that would mean if you wanted to change the layout (e.g. put the sidebar on the left instead of the right or do some funky layout which requires an additional div tag to be added) you'd have to go through every view, which does not achieve good code re-use. It is also bad practice to have lots of if statements in column2 layout just so that you can generate the sidebar correctly.

Displaying, sorting and filtering HasMany & ManyMany relations in CGridView

Created 4 years ago by yJeroenTutorials8 comments – viewed 56,667 times – ( +21 ) – version 1.1
This tutorial gives you multiple options of how to fully implement showing, sorting and filtering related data in gridviews.

The complete beginner's study guide for the Yii Framework

Created 4 years ago by Rodrigo CoelhoTips2 comments – viewed 79,697 times – ( +21 ) – version 1.1
Start studying the MVC pattern. You will understand the roles of the model, the view and the controller and know where goes each part of the code.

Using cache in CActiveDataProvider

Created 5 years ago by StammTips7 comments – viewed 19,889 times – ( +21 ) – version 1.1
First param in CActiveDataProvider could be a string with model name or instance of class. So, you may use CActiveRecord::cache() for cache, but you need set third param to 2, because you should cache 2 queries: counting and get data.