Wiki articles in category Tips

Showing 61-80 of 119 items.

An easy way to display a success page using flash messages

Created 13 years ago by qiang, updated 13 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: 56 594 times
Version: 1.1
Category: Tips

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

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

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

2 3
9 followers
Viewed: 39 931 times
Version: 1.1
Category: Tips

Create URL to language switcher anchor with langhandler

Created 9 years ago by Anas AbuDayah, updated 9 years ago by Anas AbuDayah.

This topic is related with langhandler extension

1 1
2 followers
Viewed: 10 935 times
Version: 1.1
Category: Tips

Syntax check

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

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

4 0
2 followers
Viewed: 14 815 times
Version: 1.1
Category: Tips
Tags: php, syntax

Getting nulls from database instead of empty strings

Created 12 years ago by samdark, updated 12 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: 20 042 times
Version: 1.1
Category: Tips
Tags: database, null

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

Created 12 years ago by dinhtrung, updated 12 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: 18 112 times
Version: 1.1
Category: Tips

View a related field in CGridView

Created 9 years ago by rafaelt88, updated 8 years ago by rafaelt88.

Generally we need to show one or more fields from a model that is related to another model used in CGridView. For our case we will use two related models, which explain how to use model "A" fields in a CGridView that used model "B".

2 0
3 followers
Viewed: 18 664 times
Version: 1.1
Category: Tips

adding class and links to Ctreeview node

Created 12 years ago by bingjie2680, updated 12 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: 19 529 times
Version: 1.1
Category: Tips

Customizing the CMenu Widget

Created 10 years ago by mistryb, updated 9 years ago by mistryb.

The CMenu class provides some useful features for generating menus in your web application.

1 0
4 followers
Viewed: 67 853 times
Version: 1.1
Category: Tips

Use application on production/development environment without making changes

Created 12 years ago by ifdattic, updated 12 years ago by ifdattic.

I like programing on my localhost, however it really bugged me to make changes to index.php & config files on my production server. After combining all available wiki articles on this topic and some trial and error this is what I use for my applications so I could just upload it to production server and it will work without any changes.

8 1
11 followers
Viewed: 76 756 times
Version: 1.1
Category: Tips

Directory independent extensions

Created 13 years ago by GOsha, updated 13 years ago by GOsha.

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:

// take the curr...
16 1
7 followers
Viewed: 16 883 times
Version: 1.1
Category: Tips

Using sub query for doubletts

Created 11 years ago by mb, updated 10 years ago by mb.

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.

$model=new MyModel('search');
$model->unsetAttributes();

3 0
10 followers
Viewed: 24 976 times
Version: 1.1
Category: Tips

Auto TDD - How to auto-run PHPUnit

Created 13 years ago by imehesz, updated 13 years ago by imehesz.

If you are lucky enough and have the privilege to develop on a Linux based environment, this little tip might boost-up your TDD process (at least the Unit Testing part). Please note, that this should work just fine with Apple computers also, but not tested!

3 0
6 followers
Viewed: 20 767 times
Version: 1.1
Category: Tips

CJuiTabs Content

Created 11 years ago by mbala, updated 11 years ago by mbala.

When I used CJuiTabs I did something. They are

2 0
7 followers
Viewed: 19 753 times
Version: 1.1
Category: Tips
Tags: CJuiTabs

Real Time Logging

Created 13 years ago by lucifurious, updated 13 years ago by lucifurious.

I've seen a lot of people asking about the logging facilities in Yii and thought I'd share a nice little class I wrote that provides near real-time logging.

13 0
17 followers
Viewed: 35 375 times
Version: 1.1
Category: Tips

FORM with GET method causes repeated stacking of URL Parameters

Created 9 years ago by Kartik V, updated 9 years ago by toph.

// In Yii 1.x $form = $this->beginWidget('CActiveForm', [

'id' => 'order-search-form',
'method' => 'get',

]); echo $form->textInput($searchModel, 'id'); echo CHtml::submitButton('Find', ['class' => 'btn btn-primary']); $this->endWidget(); `

7 2
41 followers
Viewed: 61 505 times
Version: all
Category: Tips

Adding 'disabled' to CCheckBoxColumn and support for yiigridview.js

Created 11 years ago by Xgamer99, updated 11 years ago by Maurizio Domba Cerin.

I recently had to have a checkbox column in my grid view that supported the 'disabled' attribute. This was easy enough to do by extending the CCheckBoxColumn. However, I also wanted the checkbox to be selected when clicking on the table's row (supported via CGridView's selectableRows option). I discovered I had to tweak yiigridview.js so that it would not select disabled rows when clicking on it o...

1 0
7 followers
Viewed: 21 342 times
Version: 1.1
Category: Tips

PHPStorm & NetBeans autocomplete problem

Created 11 years ago by Stageline, updated 11 years ago by Stageline.

The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.

12 0
14 followers
Viewed: 21 782 times
Version: 1.1
Category: Tips

Fixing extensions without modifying their code

Created 11 years ago by schmunk, updated 11 years ago by schmunk.

If you're working a lot with extensions you often stumble upon problems, when you want to include them into your custom web application, like hardcoded or absolute path aliases or classes extended from core application components, which implement addiditonal features.

6 0
10 followers
Viewed: 17 312 times
Version: 1.1
Category: Tips

How to ensure unicity to url

Created 12 years ago by zaccaria, updated 12 years ago by marcovtwout.

Many time for SEO porpouses is important that each page will have a unique address.

13 0
16 followers
Viewed: 23 673 times
Version: 1.1
Category: Tips
Tags: SEO, unique, URL