Wiki

Sorted by ratingX
Displaying 391-400 of 777 result(s).

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

Created 2 years ago by Gerhard LiebenbergHow-tos3 comments – viewed 18,840 times – ( +8 / -1 ) – version 1.1
Countries sometimes change their laws pertaining to time zones and daylight saving times. This means that GMT+2 can be a different time this August compared to last August! However, by using php's DateTime class (instead of timestamps), we can do both "format" and "time zone" 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 current and historical time zones and daylight saving times.

An important tip when you are using CArrayDataProvider.

Created 3 years ago by sirin kTips0 comments – viewed 11,097 times – ( +8 / -1 ) – version 1.1
Yii ‘s CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named “id” as primary key for its pagination purpose and what if you dont have field named “id” as primary key on your table? so its truely confusing and if you tried to display without an “id” field on ur table you will get an error like “yourmodel.id is not defined”.

Yet another implementation of CPhpAuthManager.

Created 3 years ago by seenivasanHow-tos3 comments – viewed 11,195 times – ( +8 / -1 ) – version 1.1
In this wiki, I try to implement a simple authorization schema without putting much logic inside a file or into database table. We are constructing authorization hierarchy inside the controller. We are getting roles for the current user from database table and assigning only roles to user that are declared in the particular controller. We have brought down the work of loading of auth data at main application level to controller level. This way we have pulverised auth data for entire site into smaller units. Finally we are going to look at couple of examples.

How to write a simple application component

Created 5 years ago by zaccariaHow-tos5 comments – viewed 53,251 times – ( +20 / -7 ) – version 1.1
An application component is a confortable way for share information among all component of the application

Update two models with one view

Created 4 years ago by sensorarioTips11 comments – viewed 39,038 times – ( +10 / -2 ) – version 1.1
Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).
tags: database, model, view, form

Add Beautiful Radio/Checkbox Buttons To Grid

Created 3 years ago by waterloomattHow-tos1 comment – viewed 22,215 times – ( +10 / -2 ) – version 1.1
This is a tutorial on how to create slick looking status buttons to update a model's status via a grid. Note** This tutorial uses Yii Bootstrap for styling.

Date Picker by examples

Created 2 years ago by InterboyHow-tos6 comments – viewed 85,945 times – ( +10 / -2 ) – version 1.1
CJuiDatePicker displays a datepicker. CJuiDatePicker encapsulates the JUI datepicker plugin.

Simple Mail Queue

Created 3 years ago by waterloomattTutorials3 comments – viewed 14,972 times – ( +10 / -2 ) – version 1.1
This tutorial shows how to create a simple mail queue. It is usually run from a cron job but can be run from the command line too.

get summary of related model via STAT relation

Created 2 years ago by rootbearHow-tos2 comments – viewed 14,631 times – ( +7 / -1 ) – version 1.1
typical scenario: invoice, invoice items.

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

Created 3 years ago by BoazHow-tos2 comments – viewed 13,032 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.