Wiki articles in category How-tos

Showing 1-20 of 292 items.

Using rights extension with different table and column name

Created 9 years ago by Ibrar Turi, updated 9 years ago by Ibrar Turi.

Once you have installed and configured the rights extension in your application, you can change the table name from 'User' to any table name you want and similarly for 'username' column to any other column name.

0 0
2 followers
Viewed: 6 010 times
Version: 1.1
Category: How-tos

MigrateCommand class for multiple sites using one code base

Created 11 years ago by Hudson Nguyen, updated 11 years ago by Hudson Nguyen.

My CMS supports multiple sites using one code base therefore the db connection can only be configured by detecting the site's domain.

0 0
2 followers
Viewed: 6 094 times
Version: 1.1
Category: How-tos
Tags:

Find geolocation info of client through another API

Created 9 years ago by Kostas Apazidis (KonApaz), updated 9 years ago by Kostas Apazidis (KonApaz).

This wiki shows how to get the geolocation info of the client using another server API It could be write also as extension but there are a lots of APIs that change the below code So, I wrote the below code that works for one of them (using www.geoplugin.net)

1 0
2 followers
Viewed: 8 773 times
Version: 1.1
Category: How-tos

How to limit number of guest page views

Created 10 years ago by PeRoChAk, updated 10 years ago by CeBe.

In some cases, we have to limit the number of page views for the guests users. Yii provide an efficient method to get this.

2 0
5 followers
Viewed: 8 970 times
Version: 1.1
Category: How-tos

Tarpit for bad bots

Created 12 years ago by mithereal, updated 12 years ago by mithereal.

I recently built a tarpit for bad bots.

1 0
9 followers
Viewed: 10 043 times
Version: 1.1
Category: How-tos
Tags: bots, tarpit

Localized version of CFormatter

Created 11 years ago by marcovtwout, updated 10 years ago by marcovtwout.

To replace the application component 'format', which is registered by CApplication by default, you can put this in your application 'components' config:

2 0
5 followers
Viewed: 10 116 times
Version: 1.1
Category: How-tos

Logging to Heroku's logs from Yii

Created 10 years ago by aarondfrancis, updated 9 years ago by aarondfrancis.

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 follower
Viewed: 10 285 times
Version: 1.1
Category: How-tos
1 3
3 followers
Viewed: 10 382 times
Version: 1.1
Category: How-tos

How to nest DB transactions without actually nesting them.

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

To secure your database from inconsistencies resulting from failing (complex) operations, you (should) use transactions. However, complex methods often rely on other complex methods that themselves build on transactions. This HowTo presents a method to nest or embed transactions without relying on the database's nesting capabilities.

1 0
1 follower
Viewed: 10 513 times
Version: 1.1
Category: How-tos

Entire Messages into javascript object

Created 11 years ago by markux, updated 11 years ago by markux.

I needed all messages with their translation into javascript. This is my solution:

1 0
3 followers
Viewed: 10 542 times
Version: 1.1
Category: How-tos

How to Reuse File Upload Code via Behavior

Created 9 years ago by Ahamed Rifaideen, updated 9 years ago by Ahamed Rifaideen.

hello guys now i am going to show you how to Reuse File Upload Code across multiple projects.

1 0
1 follower
Viewed: 10 748 times
Version: 1.1
Category: How-tos
1 0
5 followers
Viewed: 10 783 times
Version: 1.1
Category: How-tos
Tags: i18n, Routing

How to Enhance a CGridView

Created 10 years ago by bluyell, updated 10 years ago by CeBe.

by: Christian Salazar (bluyell, @salazachris74, christiansalazarh@gmail.com)

2 0
5 followers
Viewed: 11 494 times
Version: 1.1
Category: How-tos

CJuiDatePicker extended for more/better language support

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

The number of languages supported by the standard CJuiDatePicker implementation is limited and the language code to use is different from the application's language code. This Wiki shows how to improve on that.

1 0
1 follower
Viewed: 11 532 times
Version: 1.1
Category: How-tos

Alternative wildcard characters CDbCriteria

Created 11 years ago by maigret, updated 11 years ago by maigret.

In SQL, wildcard characters can be used in "LIKE" expressions; the percent sign (%) matches zero or more characters, and underscore (_) a single character. Sometimes users are not familiar with these or they are using different ones like (*) and (+) similar to regular expressions. My colleages do so and then i decided to add this feature by extending CbCriteria. Especially adding a new parameter $...

1 0
2 followers
Viewed: 11 586 times
Version: 1.1
Category: How-tos

Caching strategy

Created 10 years ago by darkheir, updated 10 years ago by CeBe.

Note: Before reading this wiki you should have read the caching part in the Yii guide

3 1
12 followers
Viewed: 11 795 times
Version: 1.1
Category: How-tos

Multilanguage Lorem Ipsum Text Generator

Created 11 years ago by yasen, updated 11 years ago by yasen.

Taking futher the idea from Piotr Masełkowski - http://www.yiiframework.com/extension/elipsum/ here's how to generate multilanguage Lorem Ipsum text. This example uses English and Bulgarian sample paragraphs. Create a class in /protected/components/LoremIpsum.php. Wall of text incoming wohoo...

2 0
1 follower
Viewed: 11 799 times
Version: 1.1
Category: How-tos

Console Based CAuthManager Helper

Created 9 years ago by bluyell, updated 9 years ago by bluyell.

This behavior enable you to command the RBAC via console. This avoids you to install a entire rbac graphic toolkit to set up some rules in the rbac, maybe you are running inside a ssh console.

0 0
1 follower
Viewed: 12 347 times
Version: 1.1
Category: How-tos

Mais segurança em suas aplicações com Yii e PHPIDS

Created 13 years ago by Rafael Garcia, updated 13 years ago by Rafael Garcia.

PHPIDS é conhecido projeto que pode ser visto em php-ids.org.

2 1
3 followers
Viewed: 12 444 times
Version: 1.1
Category: How-tos

How to provide a fallback or mapping for translation messages?

Created 10 years ago by schmunk, updated 9 years ago by schmunk.

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 followers
Viewed: 12 500 times
Version: 1.1
Category: How-tos