Wiki articles in category Tips

Showing 21-40 of 158 items.

An easy way to display a success page using flash messages

Created 8 years ago by qiang, updated 8 years ago by qiang.

We often need to display a success page after the user has submitted a form without problem. We may show some welcome message after a user registers a new account. There are many ways to implement this workflow. In this article, I will explain a method that exploits flash messages.

21 0
29 followers
Viewed: 46 872 times
Version: 1.1
Category: Tips

An easy way to use escopes and CActiveDataProvider

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

Often used scopes to define criteria in our models. This is a very useful feature as it ensures that in any part of application applying the criteria defined by the scope when called it.

1 1
10 followers
Viewed: 32 972 times
Version: 1.1
Category: Tips

Yii实战中8个必备常用的扩展,模块和

Created 8 years ago by Darwin Wen, updated 8 years ago by Darwin Wen.

在经过畅K网的实战后,总结一下在Yii的项目中会经常用到的组件和一些基本的使用方法,分享给大家,同时也给自己留个备忘录,下面我以代码加图片说明.

2 3
9 followers
Viewed: 35 286 times
Version: 1.1
Category: Tips

A simple action for XUpload extension

Created 8 years ago by tydeas_dr, updated 8 years ago by tydeas_dr.

All the basic functionality for an action used by the xupload extension. Check resources for the source code of this action

3 0
5 followers
Viewed: 17 711 times
Version: 1.1
Category: Tips

Using Yii with Oracle through PDO

Created 8 years ago by Trejder, updated 8 years ago by waterloomatt.

When you are developing an webapp with Yii that will be using Oracle RDBMS you should take a look at these issues in which you may run into it.

1 0
7 followers
Viewed: 57 251 times
Version: 1.1
Category: Tips

Syntax check

Created 8 years ago by Russell England, updated 8 years ago by Russell England.

This will syntax check each php file recursively from the current directory.

4 0
2 followers
Viewed: 10 726 times
Version: 1.1
Category: Tips
Tags: php, syntax

A simple class to use a different db for a module

Created 8 years ago by tydeas_dr, updated 8 years ago by Maurizio Domba Cerin.

What would you do if you want/need to have a different than the main database connection in an module's models?

8 0
12 followers
Viewed: 23 630 times
Version: 1.1
Category: Tips

Getting nulls from database instead of empty strings

Created 8 years ago by samdark, updated 8 years ago by samdark.

To get null from database instead of empty strings you need to set up your DB connection as follows:

13 0
11 followers
Viewed: 14 414 times
Version: 1.1
Category: Tips
Tags: database, null

Integrating Yii with Wordpress

Created 8 years ago by isekream, updated 8 years ago by isekream.

Well I finally had some time and tinkered a bit with the notion of integrating wordpress and Yii. Now for me I wanted to use Yii as a framework to develop wordpress plugins. Using some tips from imasia Article I was able to do a simple integration of yii as a wordpress plugin. The integratio...

9 1
13 followers
Viewed: 63 908 times
Version: 1.1
Category: Tips

Using CJuiDialog to edit rows in a CGridView

Created 8 years ago by Russell England, updated 8 years ago by Russell England.

I used Zaccarias excellent article as the base http://www.yiiframework.com/wiki/145/cjuidialog-for-create-new-model/

Solution

First follow the wiki above to create all the required code. Then make the following modifications in your...

3 1
11 followers
Viewed: 37 071 times
Version: 1.1
Category: Tips

Using MBMenu and Rights to automatically create menu item for your modules

Created 8 years ago by dinhtrung, updated 8 years ago by dinhtrung.

Using Rights generator component, we can easily create a dynamic menu, in which we scan every modules' controllers, to access the index page of them.

1 1
2 followers
Viewed: 16 309 times
Version: 1.1
Category: Tips

Search method of a model for filters when using dates - unixtimestamp in database

Created 8 years ago by Mukke, updated 8 years ago by jwerner.

I ran into a problem and on irc we worked it out. Since there is a lack on information on filters in genral i thought i'd start sharing all my findings, might be usefull for other people.

10 0
11 followers
Viewed: 31 777 times
Version: 1.1
Category: Tips

BaseModuleAR class with MultiActiveRecord

Created 8 years ago by dinhtrung, updated 7 years ago by Gustavo.

MultiActiveRecord is an extension that add support for multiple database connection for your application.

2 0
0 follower
Viewed: 11 221 times
Version: 1.1
Category: Tips

adding class and links to Ctreeview node

Created 8 years ago by bingjie2680, updated 7 years ago by bingjie2680.

This article will show you how to add links and class to each node in ctreeview. so you can attach events in js by obtaining handler on anchor or class.

4 0
6 followers
Viewed: 16 797 times
Version: 1.1
Category: Tips

Yii CDBHttpSession数据库存储session性能优化实战

Created 7 years ago by Darwin Wen, updated 7 years ago by Darwin Wen.

上一篇 关于 Yii CHttpSession性能优化篇之源码流程分析 有详细分析CHttpSession执行流程,在了解CHttpSession的详细执行流程之后,我们就可以非常轻松的扩展Yii Session,来优化和符合自己的业务流程。

1 1
1 follower
Viewed: 11 687 times
Version: 1.1
Category: Tips

an easy way to required multi columns(At least one cannot be blank)

Created 7 years ago by 1065227709, updated 7 years ago by 1065227709.

in model add the following code:

3 0
3 followers
Viewed: 9 120 times
Version: 1.1
Category: Tips
Tags: rules

Display a nice exception message on ajax requests

Created 7 years ago by Maurizio Domba Cerin, updated 7 years ago by Maurizio Domba Cerin.

in Yii versions previous to 1.1.9 exceptions was handled differently during ajax request and displayed by CApplication::displayException(). This way the exception message displayed on ajax requests could not be customized.
The message for the CGridView delete request with YII_DEBUG set to true l...

12 0
19 followers
Viewed: 43 178 times
Version: 1.1
Category: Tips

A simple action for CJuiAutoComplete

Created 8 years ago by tydeas_dr, updated 7 years ago by Thiago Souza.

Simple as that. I have placed this action in my extension folder like:

15 1
19 followers
Viewed: 44 096 times
Version: 1.1
Category: Tips

Customizing Yii's formatting rules (extending CFormatter)

Created 7 years ago by Haensel, updated 7 years ago by Haensel.

CFormatter is one of Yii's core components and used to format values displayed in widgets like CGridView or CDetailView. All classic formats like numbers, text, urls or datetime are supported but you may have to use a formatting rule that isn't built in. Let's say we want to display arrays of strings (like tags associated with a product model)...

12 0
6 followers
Viewed: 19 517 times
Version: 1.1
Category: Tips

Using cache in CActiveDataProvider

Created 7 years ago by Stamm, updated 7 years ago by Stamm.

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.

17 0
11 followers
Viewed: 24 368 times
Version: 1.1
Category: Tips