Wiki

Articles in category "tips", sorted by commentsX
Displaying 41-50 of 97 result(s).

using multiple radio button

Created about a year ago by francis jaTips2 comments – viewed 14,361 times – ( +5 )
When we use multiple radio buttons with same name in Yii many people have the problem on getting the value of the selected radiobutton. The radioButtonList can be used for that, but if we need to use radioButton itself to place the button any where in a view, we need to include one more parameter in htmloption array().

Access log output from unit tests

Created 11 months ago by MikeTips2 comments – viewed 2,998 times – ( +2 )
Say, you want to write a test for a component which provides a caching feature. How would you know, that some method of your component returns a cached result? With the solution described here you can inspect all log outputs. So you could search the logs for accesses to the DB to really make sure, that the result was served from cache.

Code style

Created 2 years ago by zaccariaTips2 comments – viewed 10,297 times – ( +28 )
Often, when writing widgets or editing Yii code, it is unclear whether or not the code is following the MVC pattern.
tags: mvc

Customize CGridView columns directly in your view

Created 9 months ago by clapasTips2 comments – viewed 9,400 times – ( +2 / -1 )
You usually take a model instance passed into your view to provide data to a CGridView in this way:

Styling Radio Buttons

Created 2 years ago by Steve FriedlTips2 comments – viewed 21,766 times – ( +10 )
The default behavior with radio button lists is ugly, and I figured out mostly how to style them a coupla different ways. I'll used the blog tutorial example (but with my own posting modes):

Quick Tip about Pagination Params

Created 2 years ago by Antonio RamirezTips2 comments – viewed 17,406 times – ( +5 )
Developing custom Grids and ListViews for my new CMS I was facing a small challenge: If I was to update/delete/batch delete items of my Grid, how would I return to the current page view?
tags: Pagination

Putting Function To Be Called In View

Created 2 years ago by junxiongTips2 comments – viewed 13,902 times – ( +4 / -1 )
Sometimes we need some complicated view to be displayed (such as generating complicated table). Most people suggest that in MVC the View must be as simple as possible (don't have too much loops, etc). So what we have to do is to hide away the complex code by putting it at somewhere else. The following are few places options to keep the function:
tags: view, render

CJuiTabs Content

Created 7 months ago by mbalaTips2 comments – viewed 5,092 times – ( +5 )
When I used CJuiTabs I did something. They are
tags: CJuiTabs

The complete beginner's study guide for the Yii Framework

Created 7 months ago by Rodrigo CoelhoTips2 comments – viewed 16,860 times – ( +18 )
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.

An easy way to display a success page using flash messages

Created 2 years ago by qiangTips2 comments – viewed 13,734 times – ( +23 )
We often need to display a success page after the user has submitted a form without problem. We may show some welcome message after a user registers a new account. There are many ways to implement this workflow. In this article, I will explain a method that exploits flash messages.