Wiki

Articles in category "tips", sorted by viewsX
Displaying 51-60 of 154 result(s).

Using cache in CActiveDataProvider

Created 6 years ago by StammTips7 comments – viewed 22,183 times – ( +21 / -1 ) – version 1.1
First param in CActiveDataProvider could be a string with model name or instance of class. So, you may use CActiveRecord::cache() for cache, but you need set third param to 2, because you should cache 2 queries: counting and get data.

Rendering Views and Updating them with Ajax

Created 4 years ago by Manish GuptaTips4 comments – viewed 21,830 times – ( +2 / -1 )
I wanted to implement a widget that could refresh itself through Ajax without refreshing the whole page. CGridView and CListView are excellent examples of such widgets.

Yii Security-extended guide

Created 6 years ago by bingjie2680Tips11 comments – viewed 21,683 times – ( +6 / -7 ) – version 1.1
This article is called extended guide is because there is already a security guide in the Yii tutorial security section. but that guide is not complete in the sense that it does not rise the developers' attention to some other commonly happening attacks: SQL injection and magic URL, which can be major vulnerabilities in your application without much caring.

Create Form With DynamicModel

Created 3 years ago by Misbahul D MunirTips4 comments – viewed 20,943 times – ( +2 / -1 ) – version 2.0
In yii2 we can create form without create FormModel. Here we go
tags: form, yii2, model

Yii2 default values for Index data Provider

Created 3 years ago by CTalaTips3 comments – viewed 20,036 times – ( +4 / -1 ) – version 2.0
Guys,

A simple class to use a different db for a module

Created 6 years ago by tydeas_drTips3 comments – viewed 19,972 times – ( +10 / -1 ) – version 1.1
What would you do if you want/need to have a different than the main database connection in an module's models?

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

Created 3 years ago by Kartik VTips0 comments – viewed 19,916 times – ( +40 / -7 ) – 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?

How to change GridView delete confirmation message for specific controllers only?

Created about a year ago by AlaFalakiTips1 comment – viewed 19,647 times – ( +2 / -1 ) – version 2.0
Hello, If you want to give extra attention for some specific delete actions and you don't want to override whole yii.confirm JS method here is what you can do: (I've only put the ActionColumn part of the GridView here to just give you the idea)

How to change the confirmation message on admingridview button and call a ajax..Dynamic

Created 4 years ago by Ankit ModiTips0 comments – viewed 19,577 times – ( +3 / -1 ) – version 1.1
Hi Friends,

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

Created 3 years ago by Scott_HuangTips0 comments – viewed 18,788 times – ( +3 / -4 ) – version 2.0
First of all, install yii2 basic template according below link: