Showing 101-120 of 292 items.

How to use bizRules in standard accessControl filter

Created 13 years ago by Maciej Liżewski Maciej Liżewski, updated 12 years ago by Maciej Liżewski Maciej Liżewski. 8 comments

I assume you are familiar with accessControl standard filter. It allows you to separate privileges to run some action from action code itself. There is however one problem with most common usage - you cannot use bizRules, at least based on some parameters passed to 'checkAccess' just because it is hard to pass them in accessRules() result.

3 0
8
Viewed: 23 892 times
Version: 1.1
Category: How-tos

How to provide a fallback or mapping for translation messages?

Created 13 years ago by schmunk schmunk, updated 11 years ago by schmunk schmunk. 1 comment

Sometimes you want to use exisiting translations for locales, which do not directly match. An example would be a website targeting Germany (de_de), Austria (de_at) and Switzerland (de_ch, fr_ch, it_ch). Although you may have exisiting translations for German (de), French (fr) and Italian (it), there are problems using it directly.

3 0
6
Viewed: 16 208 times
Version: 1.1
Category: How-tos

CGridView. Add custom class to table rows preserving original „odd“ and „even“

Created 13 years ago by Maug Lee Maug Lee, updated 12 years ago by yugene yugene. 2 comments

Lets say we have such a CGridView widget showing a list of users for administrator. Users have status „active“ or „disabled“. Grid widget puts class „odd“ or „even“ to rows and we want to preserve this. So we want to add a class „disabled“ to rows with disabled users.

Implementation

<?php
$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'user-grid',
	'dat...
7 0
4
Viewed: 59 330 times
Version: 1.1
Category: How-tos

Logging to Heroku's logs from Yii

Created 13 years ago by aarondfrancis aarondfrancis, updated 12 years ago by aarondfrancis aarondfrancis. 0 comments

In order to get your Yii logs into Heroku's logs, you have to work a little bit of magic. You'll need to modify the boot.sh script and add the following two lines: ~~~ touch /app/apache/logs/app_log tail -F /app/apache/logs/app_log & ~~~ This will set up the log and tail it so that when you request "heroku logs", this log is included.

1 0
1
Viewed: 13 395 times
Version: 1.1
Category: How-tos

Implementing menu items with progress (wait) dialog

Created 13 years ago by Trejder Trejder, updated 13 years ago by Trejder Trejder. 0 comments

This article shows one of possible ways to implement menu items (as well as links), which displays a progress / wait dialog and are redirecting browser to destination URL in the same time. This is especially useful, for links or routes that are know to be loaded for a prolonged period of time (i.e. getting a lot of data from database).

1 0
1
Viewed: 23 908 times
Version: 1.1
Category: How-tos

Yet another implementation of CPhpAuthManager.

Created 13 years ago by seenivasan seenivasan, updated 13 years ago by seenivasan seenivasan. 3 comments

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
Viewed: 22 606 times
Version: 1.1
Category: How-tos

Alternative folder structure for a standard Yii app

Created 13 years ago by Trejder Trejder, updated 13 years ago by Trejder Trejder. 4 comments

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
Viewed: 24 624 times
Version: 1.1
Category: How-tos