Wiki

Sorted by commentsX
Displaying 571-580 of 751 result(s).

Search scenario (CGridView, etc.): avoid default values from database as search condition.

Created 11 months ago by le_topTips1 comment – viewed 3,081 times – ( +1 ) – version 1.1
Yii has a neat "trick" that will assign default values to new CActiveRecords. When performing a search() though, this is pretty annoying as they automatically apply as filter values.

How to use a component before every action of a controller

Created 2 years ago by transistorTips1 comment – viewed 23,185 times – ( +2 / -1 ) – version 1.1
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.

Profiling using XDebug

Created 2 years ago by le_topHow-tos1 comment – viewed 7,285 times – ( +3 ) – version all
A short explication on how to extract profile information for PHP on your server using XDebug and KCacheGrind or WinCacheGrind.

Configuring CWebLogRoute for DB profiling

Created 3 years ago by Igor IvanovicTutorials1 comment – viewed 19,324 times – ( +3 ) – version 1.1
/index.php /protected/config/main.php
tags: logger, profiler, db

Cron Jobs in Yii

Created 2 years ago by aarondfrancisHow-tos1 comment – viewed 16,798 times – ( +4 )
I've gotten Yii running cron jobs, and wanted to explain briefly how I did it.

MongoDB's RBAC support class extending BaseManager

Created 9 months ago by edoardo849How-tos1 comment – viewed 3,802 times – version 2.0
Here's a possible implementation for MongoDb of the RBAC standard. Create a class "MongoDbManager" in common\components and modify your params.php file like this:
tags: mongodb, rbac, yii2

How to provide a fallback or mapping for translation messages?

Created 2 years ago by schmunkHow-tos1 comment – viewed 4,273 times – ( +5 ) – version 1.1
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.

Provide SVG when the browser supports it, else PNG (using CHtml::image overload)

Created 8 months ago by le_topTips0 comments – viewed 2,238 times – ( +1 ) – version 1.1
Modern browsers support SVG, older browsers do not. This replacement for CHtml::image() allows you to handle to propose SVG in an efficient way with PNG as a fallback.

model rules depended by user roles-permissions

Created 2 years ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 7,383 times – ( +3 )
This is a reference about model validators and user roles. In many cases we want model validators to applied only for some privileged users or not

Analyse the server's USER-AGENT against browsecap file to determine it's capability.

Created 8 months ago by Deepak PradhanTips0 comments – viewed 1,844 times – version 2.0
Does your application need to know user's details on browser details, os and device type? We can use PHP's misc. function to achieve that provided you have an update copy of browsercap.ini