Sorted by commentsX
Displaying 581-590 of 761 result(s).

How to change Migration Table name and use defined prefix.

Created 2 years ago by JorgeeHow-tos1 comment – viewed 8,188 times – ( +3 ) – version 1.1
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.

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

Created about a year ago by le_topTips1 comment – viewed 3,659 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 25,815 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 8,033 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 4 years ago by Igor IvanovicTutorials1 comment – viewed 20,557 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 18,196 times – ( +4 ) – version 1.1
I've gotten Yii running cron jobs, and wanted to explain briefly how I did it.

Behaviour for Time Zone and Format conversion for Date, Time, timestamp, and datetime

Created about a year ago by SmitheshHow-tos1 comment – viewed 5,430 times – ( +3 ) – version 1.1
This Behaviour helps to view time/date/timestamp/datetime from db to local Date / Time / Date Time format and in local Timezone. And save into db in with db timezone and db format. You only need to include this behaviour in models where need this facility.

MongoDB's RBAC support class extending BaseManager

Created about a year ago by edoardo849How-tos1 comment – viewed 4,373 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,655 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 about a year ago by le_topTips0 comments – viewed 2,666 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.