Wiki articles

Showing 121-140 of 799 items.

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 691 times
Version: 1.1
Category: Tips

Using a CDbDataReader (sql query result) in a zii widget (such as CGridView or CListView)

Created 7 years ago by Revelis Luc Bonnin, updated 7 years ago by Revelis Luc Bonnin.

If in your application you have to proceed to a complex SQL query that is not associated to a model, you will use CDbDataReader like it is described in the Yii documentation. An example could be

8 1
8 followers
Viewed: 30 470 times
Version: 1.1
Category: How-tos

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 124 times
Version: 1.1
Category: Tips
Tags: rules

Run Yiic directly from your app without a shell

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

Whatever reason, it turns out to be easy enough to add that feature to your application. :)

13 0
20 followers
Viewed: 41 028 times
Version: 1.1
Category: How-tos

How to use EzComponents in Yii

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

change your index.php

4 0
6 followers
Viewed: 10 669 times
Version: 1.1
Category: How-tos

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 183 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 103 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 518 times
Version: 1.1
Category: Tips

Avoiding duplicate script download when using CActiveForm on Ajax calls

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

The only thing required is simple, we just need to create a view that will be partially rendered by a call to a controller (using renderPartial) and make sure that we process output -setting to true the parameter on the function. Everything will work as expected but...

11 1
9 followers
Viewed: 22 408 times
Version: 1.1
Category: Tutorials

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 370 times
Version: 1.1
Category: Tips

Caching the config main.php

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

The config first required In CApplication constructor

4 1
14 followers
Viewed: 17 976 times
Version: 1.1
Category: Tutorials

Configuring CWebLogRoute for DB profiling

Created 7 years ago by Igor Ivanovic, updated 7 years ago by Igor Ivanovic.

require_once($yii); Yii::createWebApplication($config)->run();

2 0
6 followers
Viewed: 29 970 times
Version: 1.1
Category: Tutorials

Multilanguage web site controlling by get request and database allowed languages

Created 8 years ago by Igor Ivanovic, updated 7 years ago by rei.

First, you have to have create database table for default language and allowed languages.

CREATE TABLE IF NOT EXISTS `tbl_languages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `lang` varchar(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `flagpath` varchar(40) CHARACTER SET utf8 COLLATE utf8_unicode_...
5 0
13 followers
Viewed: 25 065 times
Version: 1.1
Category: Tutorials

Shrink Yii, help your IDE and speed up copying

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

yii-1.1.8.r3324 framework directory is 10.4 mb size.

9 8
17 followers
Viewed: 11 694 times
Version: 1.1
Category: Tips

Send asset folder path to a javascript of a widget

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

When you develop a widget, you could need one image that is in the assets folder, you can use it simply within a css. You can load a css or javascript script doing this:

Yii::app()->getClientScript()->registerCssFile($filename);
4 0
9 followers
Viewed: 27 777 times
Version: 1.1
Category: Tips

free PHP IDE CodeLobster supports Yii framework

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

This page is created to supply short directions and general tips for managing a Yii application in Codelobster PHP Edition.

5 0
1 follower
Viewed: 16 952 times
Version: 1.1
Category: Tutorials

how to use github (un)official extension repo in your Yii project

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

I'm developing a web project for a company using Yii framework. We are using a git vcs in our development process. We like to use Yii extensions. But only if they are good.

4 0
8 followers
Viewed: 10 037 times
Version: 1.1
Category: Tips

Reliable Alternative For Yii::app()->request->isAjaxRequest AND Adding Data To Ajax Form With JS

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

In this How-To I'll show you:

12 1
11 followers
Viewed: 54 220 times
Version: 1.1
Category: How-tos

Special $variables in CGridView and CListView

Created 7 years ago by Steve Friedl, updated 7 years ago by Steve Friedl.

The popular [CListView] and [CGridView] widgets each take a data provider and iterate over each data object produced, calling the user's code to render each row one at a time, and most are familiar with the use of the $data variable to represent the current model object or array.

22 1
33 followers
Viewed: 70 662 times
Version: 1.1
Category: Tips

Como trasponer una lista creada con CHtml::checkBoxList

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

En ciertas ocasiones tenemos que lidiar con el tema de colocar una lista de checkboxes para hacer una seleccion especifica como es el caso de los dias de la semana para un calendario, para esta labor tenemos el comando CHtml::checkBoxList(), revisando un poco el funcionamiento de este temos los siguientes parametros:

2 0
4 followers
Viewed: 14 995 times
Version: 1.1
Category: Tips