Wiki

Articles in category "how-tos", sorted by ratingX
Displaying 161-170 of 315 result(s).

get summary of related model via STAT relation

Created about a year ago by rootbearHow-tos2 comments – viewed 8,274 times – ( +7 / -1 ) – version 1.1
typical scenario: invoice, invoice items.

i18n All-in-one format and timezone conversions for date, time, timestamp and datetime.

Created about a year ago by Gerhard LiebenbergHow-tos3 comments – viewed 11,485 times – ( +7 / -1 ) – version 1.1
Most of the currently available functions/extensions/behaviors directly or indirectly use timestamps to perform "format" and "timezone" conversions. This creates problems for dates falling outside the timestamp range; and the two forms of conversions must often be done in separate processes. However, by using php's DateTime class (instead of timestamps), we can do both conversions on a single DateTime object (only 2 lines of code) for date, time, timestamp and datetime types - while php takes care of nightmares such as daylight saving times and more importantly, historical changes in timezones and daylight saving times.

How to "masquerade" a non-required form element as 'required' one (in the view only)

Created 2 years ago by BoazHow-tos2 comments – viewed 8,525 times – ( +7 / -1 ) – version 1.1
In a nutshell, the task at hand is to mark (or render) a model attribute in the typical "_form.php" view file with the 'required' red asterisk while this attribute is not marked as required in the model's rule() method. If you're interested only in the solution, jump ahead to the 'solution' section below.

Yii registry, how to use it, does it exist at all?

Created 3 years ago by dckurushinHow-tos2 comments – viewed 18,042 times – ( +7 / -1 ) – version 1.1
From time to time people ask about registry...

How to include Javascript, CSS

Created about a year ago by InterboyHow-tos2 comments – viewed 297,255 times – ( +9 / -2 ) – version 1.1
There are many methods that we can include javascript, css into your Yii App. Today I will demonstrate three simple and helpul methods.

Date Picker by examples

Created about a year ago by InterboyHow-tos5 comments – viewed 43,541 times – ( +9 / -2 )
CJuiDatePicker displays a datepicker. CJuiDatePicker encapsulates the JUI datepicker plugin.

CGridView Date Range Without Cookies or Session (External Filtering)

Created about a year ago by ezekielnoobHow-tos5 comments – viewed 7,085 times – ( +4 )
Here's a tutorial on how to create a CGridView with external date filters the trick is to create hidden columns within the CGridView Filters something like in the example below:

Visualization tree-multi subcategories as listbox or dropdownlist

Created about a year ago by KonApazHow-tos4 comments – viewed 10,032 times – ( +4 ) – version 1.1
Do you want to make a listbox or dropdownlist to select one or more categories or sub categories ?

How to obtain a grammatically correct translation of the model name in giix-generated view files

Created 2 years ago by c@cbaHow-tos0 comments – viewed 8,625 times – ( +4 ) – version 1.1
The giix code generator has out of the box i18n support for model names and attribute labels (besides other cool features > check it out!) . But I want to factor in not only the plural form, but also the grammatical cases (especially the accusative) while translating 'Manage Objects', 'Create Object', 'Edit Object' etc.

Create a custom menu using CMenu data-items (flat or tree structure)

Created about a year ago by KonApazHow-tos0 comments – viewed 10,696 times – ( +4 )
There are cases that you want more control to your menu Suppose you want a specific menu with complex css, layout, images. also you want to add extra content,html,css,javascript etc it run time foreach submenu item by conditions.