Wiki

Articles in category "how-tos", sorted by date (updated)X
Displaying 101-110 of 302 result(s).

How to Enhance a CGridView

Updated 3 months ago by CeBeHow-tos5 comments – viewed 2,398 times – ( +4 ) – version 1.1
by: Christian Salazar (bluyell, @salazachris74, christiansalazarh@gmail.com)

Select2 Infinite Scroll With Remote Data in Yii

Updated 3 months ago by CeBeHow-tos5 comments – viewed 2,987 times – ( +4 ) – version 1.1
I was able to set up the infinite scroll of select2 in Yii. I am glad to share it with you. The demo and source code can be found here. However, select2 for Yii can be found here which uses a widget.

Localized version of CFormatter

Updated 4 months ago by marcovtwoutHow-tos2 comments – viewed 3,395 times – ( +3 ) – version 1.1
Since Yii 1.1.14, a CLocalizedFormatter is available.

Using CJuiDatePicker for CGridView filter

Updated 4 months ago by KonApazHow-tos12 comments – viewed 30,366 times – ( +20 ) – version 1.1
We can use a CJuiDatePicker for a CGridView inline filter.

Syncing sessions between Yii and KCFinder

Updated 4 months ago by BoazHow-tos7 comments – viewed 4,702 times – ( +1 ) – version 1.1
Info: As KCFinder's documentation mentions, if your application (Yii in our case) session handling is using the PHP environment configuration - meaning no change in session handling at all, then no change is needed also on KCFinder side to be able to use this session and thus have this simple interface between your Yii webapp and KCFinder. If that's your case then you probably need not read the rest of this article but rather just make sure that before a user attempts to upload or browse your server a session variable is already set for him (or her) with his specific configuration already waiting for KCFinder there. What can this session interface be useful for? For example, for having per-user upload directory. You could have uploadURL variable established in the session variable to contain the user's id. When an upload or browse use case will occur, the client side will trigger the KCFinder completely decoupled from the Yii application. Yet, since you've already synced your user-specific-configuration with KCFinder via the session, KCFinder will pick it up and use it.
tags: File upload

Configuring controller access rules to default-deny

Updated 6 months ago by nsandenHow-tos3 comments – viewed 54,715 times – ( +11 ) – version 1.1
Starting with the blog tutorial, Yii developers are familiar with the notion of access rules defined in the controller, where the actions are allowed or denied depending on the user's name or role.

Getting the Most out of APC for Yii

Updated 7 months ago by Da:SourcererHow-tos10 comments – viewed 24,414 times – ( +16 ) – version 1.1
The Advanced PHP Cache is a PHP extension which primarily serves as an opcode cache for PHP. The basic idea is to save PHP from re-evaluating the PHP code to intermediate bytecode on each request. Installing and enabling APC already yields a significant performance benefit. However, APC is not a black box that will magically change all for the better. More over it is important to understand that APC needs memory to operate.
tags: caching, apc

Dynamic Sidebar using CClipWidget

Updated 7 months ago by CozumelHow-tos5 comments – viewed 21,527 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.

Drop down list with enum values for column of type ENUM >+> incorporate into giix

Updated 7 months ago by nsandenHow-tos2 comments – viewed 22,480 times – ( +14 ) – version 1.1
Let's say our table 'mug' has a column named 'color' of the type ENUM('red','green','blue'). We want to replace the textfield for the attribute color in the create and update forms of a 'mug' with a drop down list, which has the enum values as options. The main code was contributed by zaccaria in the forum (see this post).

jQuery UI Datepicker

Updated 7 months ago by ShahcheragheanHow-tos11 comments – viewed 43,528 times – ( +12 ) – version 1.1
We all love the convenient gadget, namely jQuery UI Datepicker as an input element for date. Yii supports it as CJuiDatePicker. Let's see how to use it.