Wiki

Sorted by date (updated)X
Displaying 71-80 of 599 result(s).

Relational Query - Lazy Loading and Eager Loading / with and together

Updated 3 months ago by softarkTutorials9 comments – viewed 12,028 times – ( +12 )
It's well known that there are Lazy Loading approach and Eager Loading approach in the relational query. But it's important to note that you should distinguish 2 different modes in the Eager Loading in Yii 1.1.x.

Getting the Most out of APC for Yii

Updated 4 months ago by Da:SourcererHow-tos10 comments – viewed 21,805 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

How to upload a file using a model

Updated 4 months ago by KonApazTutorials26 comments – viewed 271,322 times – ( +80 / -6 ) – version 1.1
First declare an attribute to store the file name in the model class (either a form model or an active record model). Also declare a file validation rule for this attribute to ensure a file is uploaded with specific extension name.
tags: File upload

Dynamic Sidebar using CClipWidget

Updated 4 months ago by CozumelHow-tos5 comments – viewed 20,477 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.

How to use ldap in UserIdentity for authentication

Updated 4 months ago by NavarrTutorials14 comments – viewed 31,857 times – ( +11 ) – version 1.1
Yii does not have an LDAP class itself, but its very easy to implement LDAP in the stock UserIdentity class.

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

Updated 4 months ago by nsandenHow-tos2 comments – viewed 20,435 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 4 months ago by ShahcheragheanHow-tos9 comments – viewed 37,627 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.

Creating a dependent dropdown

Updated 4 months ago by ShahcheragheanTutorials36 comments – viewed 215,693 times – ( +103 / -3 ) – version 1.1
Often you'll need a form with two dropdowns, and one dropdown's values will be dependent on the value of the other dropdown. Using Yii's built-in AJAX functionality you can create such a dropdown.

Adding a date range search for CGridView the easy way

Updated 4 months ago by mikewalenTips4 comments – viewed 12,863 times – ( +10 ) – version 1.1
After a lot of research, everything I found on adding date range searching to a CGridView advanced search form seemed to involve adding two new public variables (e.g. $date_from, $date_to), 'safe' rules for the new variables, and a rather chunky if/elseif/else check in the search() method. This probably isn't a hassle for most, but because many of the tables in my database contain two or three and sometimes four date columns (e.g. date_created, date_modified, date_deleted etc.), it meant I was having to add up to eight public variables, the corresponding safe rules, and modifying the search() criteria for each date attribute. So, I set about creating a better way and I thought I'd share my work with the community.

Catching bounce messages (NDR) and piping them to a Yii command

Updated 5 months ago by bennounaTutorials0 comments – viewed 5,513 times – ( +1 ) – version 1.1
In order to avoid bounce messages and unsolicited registrations, most webapps send automatic activation emails upon user registration, and the account remain inactive as long as it is not activated. Better yet, you can periodically purge your data by removing accounts that have not yet been activated.