Wiki

Sorted by viewsX
Displaying 111-120 of 718 result(s).

Ajax update

Created 4 years ago by zaccariaTips2 comments – viewed 42,459 times – ( +21 / -2 ) – version 1.1
Often happens to have the need of change a part of the page with ajax.
tags: AJAX

X-Sendfile - serve large static files efficiently from web applications

Created 3 years ago by Maurizio Domba CerinHow-tos5 comments – viewed 42,398 times – ( +26 ) – version 1.1
Normally when we want users to download a file, that file is put in a folder under the web application root and the web server does the rest.

How to hide index.php on nginx

Created 5 years ago by milesTutorials3 comments – viewed 41,945 times – ( +4 ) – version 1.1
For a complete sample Nginx+PHP-FPM config, view this how-to: Nginx & PHP-FPM
tags: URL

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 2 years ago by c@cbaTutorials3 comments – viewed 41,578 times – ( +28 / -1 ) – version 1.1
    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this: 'value'=>'$data->author->username',.     Now we might want to use $data in the declaration of the htmlOptions attribute, which is normally not possible, to generate for example the tag <td id="3" class="name_3">, where 3 is the id of the data model for the current row, i.e. $data->id. That is, we want to be able to use: 'htmlOptions'=>array('id'=>'$data->id', 'class'=>'"name_{$data->id}"')     Here's a way to accomplish this...

Creating a database-driven hierarchical Structure combined with CMenu and superfish

Created 4 years ago by thyseusTutorials9 comments – viewed 41,458 times – ( +15 ) – version 1.1
Note: Please also take a look at the newer EMenu extension. This works even better that the deprecated CDropDownMenu!
tags: menu

Use shortcut functions to reduce typing

Created 5 years ago by qiangTutorials8 comments – viewed 41,372 times – ( +56 ) – version 1.1
Because Yii intends to be integrated nicely with third-party libraries, it does not define any global functions. Everything in Yii needs to be addressed with full class name or object scopes. For example, to access the current user, we need to use Yii::app()->user; to access application parameters, we need Yii::app()->params['name']; and so on. While editors like textmate can help alleviate the problem of these lengthy typings, it is worthwhile to define global shortcut functions to some commonly used method calls. They will make the application code look cleaner.

How to use single form to collect data for two or more models (CActiveForm and Ajax Validation edition)

Created 3 years ago by RusAlexHow-tos9 comments – viewed 41,350 times – ( +22 ) – version 1.1
With Yii you can use one CActiveForm for collecting data for two or more models with ajax validation and client validation.

Send mail using YiiMail extension

Created about a year ago by RKATutorials8 comments – viewed 41,149 times – ( +8 ) – version 1.1
Let me show a simpe example to send mail using YiiMail extension in 5 steps. It also includes any template view if required along with the content.
tags: YiiMail

How to write a simple application component

Created 3 years ago by zaccariaHow-tos5 comments – viewed 41,073 times – ( +19 / -7 ) – version 1.1
An application component is a confortable way for share information among all component of the application

Moving project code outside of webroot (plus multiple project support)

Created 4 years ago by Steve FriedlHow-tos8 comments – viewed 40,420 times – ( +22 / -1 ) – version 1.1
Yii's by-default directory organization works well enough, but there are several steps one can take that improve the security and serviceability of the system, especially in the context of multiple Yii projects on the same machine (including multiple versions of the same project).
tags: config, security