Wiki

Sorted by viewsX
Displaying 81-90 of 470 result(s).

Use shortcut functions to reduce typing

Created 4 years ago by qiangTutorials8 comments – viewed 27,310 times – ( +47 )
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.

Display an AJAX tree from your DB using CTreeView

Created 3 years ago by François GannazTutorials9 comments – viewed 26,987 times – ( +20 )
This example uses a MySQL DB with a table named tree with the fields id, name, and parent_id. The parent_id will be NULL for root elements. The SQL is kept simple (no autoinc, no FK, etc).
tags: AJAX, CTreeView

Using the configuration file, explain what can be configured.

Created 3 years ago by atrandafirTutorials0 comments – viewed 26,445 times – ( +18 )
The purpose of this post is to let anyone quickly find how to accomplish a configuration task, and list here all the posibilities of the config.php file and also link to pages that explain how is each thing implemented.

Implementing a User Level Access System

Created 2 years ago by Antonio RamirezTutorials9 comments – viewed 26,438 times – ( +27 )
I would like to provide you a quick tip on how to implement user level access to your Yii applications.

Saving files to a blob field in the database

Created 2 years ago by zaccariaTips7 comments – viewed 26,434 times – ( +6 / -2 )
As a follow-up from the How to upload a file using a model wiki entry that explains how to save a file to the filesystem, this article will do the same using a blob field in the database.
tags: File upload

How to display static pages in Yii?

Created 4 years ago by qiangTutorials2 comments – viewed 26,419 times – ( +14 )
In a Web application, we often need to display pages like "about this site", "legal information", whose content are mostly static. There are several approaches to deal with this kind of pages.
tags: static pages

Using Yii with Nginx and PHP-FPM

Created 2 years ago by LericHow-tos10 comments – viewed 25,864 times – ( +17 )
This config is built on an Ubuntu 11.04 server. Software is nginx, php-fpm (php5-fpm). For performance, it's recommended to run php-fpm in SOCKET mode, instead of accessing via IP:PORT. That is the method shown below.

htmlOptions explained for various controls.

Created 2 years ago by WoilTips1 comment – viewed 24,707 times – ( +16 )
Most controls that are rendered by CHtml have an argument called $htmlOptions. This argument is an array that holds the attributes of the HTML element. For example the following code:

How to add ajax-loading indicators

Created 3 years ago by schmunkTutorials5 comments – viewed 24,567 times – ( +25 )
With yii you're able to create ajax requests and updates easily. But most times you always want to show a loading indicatior to your user.
tags: AJAX