Wiki

Articles in category "tips", sorted by ratingX
Displaying 1-10 of 123 result(s).

Guidelines for good schema design

Created 2 years ago by Steve FriedlTips13 comments – viewed 51,760 times – ( +138 ) – version 1.1
Virtually all Yii applications are built on top of a database, and though Yii is very flexible in how it addresses your DB, some design choices make things more convenient than others.

CGridView: Render customized/complex datacolumns

Created 2 years ago by JobloTips13 comments – viewed 99,965 times – ( +69 ) – version 1.1
If you have to display a overview of related data in a table, you can use the CListView, create your view with table/tr/td tags and implement db-queries in the view to display detaildata of the current (master-)record.
tags: CGridView

Extending common classes to allow better customization

Created 3 years ago by Steve FriedlTips0 comments – viewed 19,585 times – ( +41 ) – version 1.1
The two most commonly-used base classes in most Yii applications are CController and CActiveRecord, each extended to your own particular models and controllers.

Configuring PhpStorm IDE for Yii

Created 3 years ago by samdarkTips20 comments – viewed 67,026 times – ( +61 / -1 ) – version 1.1
In order to be able to get from render or renderPartial to the view, from widget to widget class, from relations to model classes you need to install additional plugin called YiiStorm.
tags: IDE, PhpStorm

Code style

Created 3 years ago by zaccariaTips2 comments – viewed 12,758 times – ( +29 ) – version 1.1
Often, when writing widgets or editing Yii code, it is unclear whether or not the code is following the MVC pattern.
tags: mvc

Adding Yii Search to Your Browser Search Box

Created 3 years ago by qiangTips1 comment – viewed 29,624 times – ( +28 ) – version 1.1
The official Yii project site now supports OpenSearch. This means you can customize your browser's search box to enable direct search of the content in yiiframework.com. For example, by entering a Yii class name in the browser's search box, the corresponding class API page will be shown in the browser.
tags: search

URL component access functions

Created 3 years ago by Steve FriedlTips1 comment – viewed 9,851 times – ( +28 ) – version 1.1
Many applications wish to obtain parts of the URL for the current page (the hostname, the query string, etc.), and the CHttpRequest class wraps various $_SERVER variables to break down the URL into its constituent parts.
tags: URL, request

An easy way to display a success page using flash messages

Created 3 years ago by qiangTips2 comments – viewed 21,121 times – ( +26 ) – version 1.1
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.

Reading the doc

Created 3 years ago by zaccariaTips0 comments – viewed 6,241 times – ( +21 ) – version 1.1
Almost all the information you need whilst working with yii is written in the Class Reference.
tags: doc

The complete beginner's study guide for the Yii Framework

Created about a year ago by Rodrigo CoelhoTips2 comments – viewed 39,280 times – ( +20 ) – version 1.1
Start studying the MVC pattern. You will understand the roles of the model, the view and the controller and know where goes each part of the code.