Wiki articles

Showing 201-220 of 650 items.

How to use a component before every action of a controller

Created 6 years ago by transistor, updated 6 years ago by transistor.

I guess this is a tip on how to execute some code before every action in a controller, because I will tell you how I did it and maybe you can use the idea in your project.

2 0
4 followers
Viewed: 43 746 times
Version: 1.1
Category: Tips

How to implement an event and attach it in a behavior

Created 6 years ago by seb7, updated 6 years ago by seb7.

This page explains how to implement an event and catch that event in a behavior.

2 0
9 followers
Viewed: 23 313 times
Version: 1.1
Category: How-tos

Yet another implementation of CPhpAuthManager.

Created 6 years ago by seenivasan, updated 6 years ago by seenivasan.

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 ma...

5 1
7 followers
Viewed: 15 262 times
Version: 1.1
Category: How-tos

CGridView: Adding behaviors from configuration, and template items from behaviors to CGridView

Created 6 years ago by le_top, updated 6 years ago by le_top.

Changing the way a CGridView is rendered from the configuration file, or through behaviors specified at the moment it is used, is handy to extend a CGridView without creating tons of different classes for it. I am surprised that this is not in the default implementation, so I made my default CGridView implementation.

3 0
3 followers
Viewed: 12 138 times
Version: 1.1
Category: Tips

Alternative folder structure for a standard Yii app

Created 6 years ago by Trejder, updated 6 years ago by Trejder.

I found a standard Yii app's protected folder structure nearly perfect. With a few simple moves and a little bit change to the code, I managed to bring it to the level, which I found as fully perfect. I want to share my point of view, in case someone would like to use this structure as well.

3 0
9 followers
Viewed: 17 623 times
Version: 1.1
Category: How-tos

How to change Migration Table name and use defined prefix.

Created 6 years ago by Jorgee, updated 6 years ago by jamband.

To accomplish the task of changing Migration table's name, by default tbl_migration, you need to add the following in your ./protected/config/console.php.

3 0
5 followers
Viewed: 15 475 times
Version: 1.1
Category: How-tos

Using Google Maps in Yii Applications via Jquery

Created 6 years ago by bluyell, updated 6 years ago by bluyell.
2 0
6 followers
Viewed: 18 873 times
Version: 1.1
Category: How-tos

Implementing a Flat User Access System

Created 6 years ago by Trejder, updated 6 years ago by Trejder.

This article shows a quick and easy way to implement flat user access control system. Flat means, that user access is controlled by level only, which is solution exactly opposite to complex RBAC access systems.

6 0
7 followers
Viewed: 13 999 times
Version: 1.1
Category: How-tos

How to use the official Yii installer for Composer (**DEPRECATED**)

Created 6 years ago by br0sk, updated 6 years ago by br0sk.

This wiki shall be considered deprecated since the Yii installer for composer has been discontinued.

3 0
10 followers
Viewed: 46 983 times
Version: 1.1
Category: How-tos
11 0
20 followers
Viewed: 29 209 times
Version: 1.1
Category: How-tos

CjuiDatepicker

Created 6 years ago by hiral darji, updated 6 years ago by hiral darji.

If you have two datepicker in one form and you want that a date of from date shold be minimum date of todate then put following code in Cjuidatepicker widget options array:

'onSelect'=>'js:function(selected) {
$("#HostelRoomStatusMaster_room_status_master_end_date").datepicker("option","minDate",selected);
				}',
1 0
5 followers
Viewed: 9 466 times
Version: 1.1
Category: Tips

using jqbargraph to create beautiful graphs

Created 6 years ago by MAHESH.E.U, updated 6 years ago by MAHESH.E.U.

If you are about to create a graph, the best option i would suggest is the jqbargraph.

5 0
9 followers
Viewed: 9 990 times
Version: 1.1
Category: Tips

Send mail using YiiMail extension

Created 6 years ago by RKA, updated 6 years ago by RKA.

Step1: Download the extension from path 'http://code.google.com/p/yii-mail/downloads/list' .

5 0
18 followers
Viewed: 86 928 times
Version: 1.1
Category: Tutorials
Tags: YiiMail

Using Grunt for deploying client scripts

Created 6 years ago by Chris83, updated 6 years ago by Chris83.

For a long time I have struggled to find a suitable tool for doing server tasks such as compiling LESS files, concatenating and minifying of JavaScript files and copying the minified JavaScript files. While most of these tasks can be done with Yii extensions I would still not recommend using them because it requires you to include these extensions in your project, and therefore also deploying them...

8 0
7 followers
Viewed: 21 194 times
Version: 1.1
Category: How-tos

A simple way to get Yii client-side form validation run when submitting by ajax

Created 6 years ago by nlac, updated 5 years ago by nlac.

A time ago i've met the issue that Yii doesn't run any client-side form validation when submitting the form by CHtml::ajaxSubmitButton. The small javascript below helps to fix it.

4 1
11 followers
Viewed: 55 865 times
Version: 1.1
Category: Tutorials

Open Dialog from ajax content

Created 6 years ago by Touzas, updated 6 years ago by Touzas.

This is the code in the View.

<?php echo CHtml::link('MyDialog', Yii::app()->createUrl('site/page'), array('class' => 'openDlg divDialog')); ?>
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id'=>'divDialog',
	'options'=>array( 'title'=>Yii::t('Dialog Title', 'autoOpen'=>false, 'modal'=>true, 'width'=>600)));
?>
	<div class="divForForm"></div>
<?php
$this->endWidget(...
3 1
5 followers
Viewed: 20 449 times
Version: 1.1
Category: How-tos

Custom Login Error Messages

Created 6 years ago by whoopass, updated 6 years ago by whoopass.

The Yii Framework is very powerful and it provides a lot of functionality right from the pre-built webapp. One of the nice things that is already established for you as a developer is the Login authentication. While the default configuration simply sets it up to run against an array of hard coded usernames and passwords, the [Yii Blog Tutorial](http://www.yiiframework.com/doc/blog/1.1/en/prototype...

6 0
9 followers
Viewed: 44 131 times
Version: 1.1
Category: Tutorials

Yii for beginners 2

Created 6 years ago by rackycz, updated 2 months ago by rackycz.

This is second article with my tutorial. I had to add it, because Wiki article has limited length and as I was extending it's text, older paragraphs were disappearing. So here I am starting from chapter 6.

15 0
22 followers
Viewed: 63 036 times
Version: 1.1
Category: Tutorials

Adding a date range search for CGridView the easy way

Created 6 years ago by mikewalen, updated 6 years ago by mikewalen.
  1. Create an Active Record Behavior that builds the criteria for the search() method and attach it to your model
  2. Modify the search() method of the model to merge the behavior's criteria in with the rest of the searchable attributes
  3. Modify the _search form view to add the date range inputs
6 0
11 followers
Viewed: 36 975 times
Version: 1.1
Category: Tips