Wiki

Articles in category "tips", sorted by viewsX
Displaying 81-90 of 152 result(s).

How to catch and log MySQL deadlock errors

Created 4 years ago by sebTips1 comment – viewed 11,462 times – ( +4 ) – version 1.1
This method allows to log InnoDB monitor output when deadlock error occured. This way we will have much more useful data to find and fix deadlock.
tags: database

Using sub query for doubletts

Created 3 years ago by mbTips3 comments – viewed 11,449 times – ( +2 ) – version 1.1
find doubletts by db fields. in this example i will check doublets for 3 tabelfields (col1,col2,col3). so i will get a subquery with the condition, select and grouping of the tablefields. the having with COUNT() > 1 means: find all records more then one result.

Yii code completion and calltips in Komodo Edit

Created 5 years ago by viterTips1 comment – viewed 11,305 times – ( +6 ) – version 1.1
My favourite editor is Komodo Edit (free and crossplatform) and I use it for my everyday coding work. Just recently I found out how to make it help me to work with Yii. :) So follow these steps:
tags: Komodo Edit

Getting nulls from database instead of empty strings

Created 5 years ago by samdarkTips2 comments – viewed 11,152 times – ( +13 ) – version 1.1
To get null from database instead of empty strings you need to set up your DB connection as follows:
tags: database, null

Install specific Yii2 vendor extension & dependency without updating other packages.

Created 2 years ago by Kartik VTips0 comments – viewed 10,953 times – ( +40 / -6 ) – version 2.0
The tips here are for advanced usages of composer and its assumed you have read about using composer and have a knowledge of your vendor packages to be updated. Let's consider, you want to update only one specific yii2 vendor library, without updating all the other extension packages?

An important tip when you are using CArrayDataProvider.

Created 3 years ago by sirin kTips0 comments – viewed 10,855 times – ( +8 / -1 ) – version 1.1
Yii ‘s CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named “id” as primary key for its pagination purpose and what if you dont have field named “id” as primary key on your table? so its truely confusing and if you tried to display without an “id” field on ur table you will get an error like “yourmodel.id is not defined”.

Easy way to redirect http:\\localhost\yii2-basic to http:\\localhost\yii2-basic\web\index.php

Created about a year ago by Scott_HuangTips0 comments – viewed 10,688 times – ( +3 / -3 ) – version 2.0
First of all, install yii2 basic template according below link:

Directory independent extensions

Created 5 years ago by GOshaTips3 comments – viewed 10,539 times – ( +16 / -1 ) – version 1.1
Many people want to use downloaded extensions in their own way. As for me most of the extensions require me to correct Yii::import() instructions inside their source code. All these extensions are directory dependent. To avoid the situation described above, I suggest to implement pseudo-anonymous aliases:

CGridView customized CCheckBoxColumn

Created 2 years ago by chandranTips2 comments – viewed 10,488 times – ( +5 ) – version 1.1
Hi friends,

Model validation for field ranges using yii2-field-range extension

Created 2 years ago by Kartik VTips0 comments – viewed 10,414 times – ( +39 ) – version 2.0
The yii2-field-range extension enables you to easily setup ActiveField range fields with Bootstrap styling. You basically can setup two attributes joined together like a single field with combined validation error block.