Wiki

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

An important tip when you are using CArrayDataProvider.

Created 4 years ago by sirin kTips0 comments – viewed 11,562 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,540 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 54,573 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,827 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 23,067 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 3 years ago by InterboyHow-tos6 comments – viewed 90,396 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 15,725 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.

Show captcha after <N> unsuccessfull attempts

Created 4 years ago by zitterHow-tos7 comments – viewed 20,504 times – ( +15 / -5 ) – version 1.1
In this mini howto I would like to show how to add a required captcha field in the login form, after a defined number of unsuccessfull attempts. To do this, I will use the blog demo that you have in default Yii download package (path/to/yii/demos/blog).

get summary of related model via STAT relation

Created 3 years ago by rootbearHow-tos2 comments – viewed 15,404 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 4 years ago by BoazHow-tos2 comments – viewed 13,607 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.