Wiki

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

Guidelines for good schema design

Created 3 years ago by Steve FriedlTips15 comments – viewed 57,201 times – ( +140 ) – 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 111,645 times – ( +72 ) – 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

Configuring PhpStorm IDE for Yii

Created 3 years ago by samdarkTips20 comments – viewed 75,457 times – ( +64 / -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

Extending common classes to allow better customization

Created 3 years ago by Steve FriedlTips0 comments – viewed 21,696 times – ( +42 ) – 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.

Code style

Created 3 years ago by zaccariaTips2 comments – viewed 13,588 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

Key web server settings after installing a fresh Yii 2 basic or advanced app

Created 3 months ago by Kartik VTips0 comments – viewed 1,917 times – ( +29 ) – version 2.0
So, you have installed a brand new Yii 2 app (basic) or (advanced). Here are a few tips for Apache web server users to get things running more secure and better with your yii2 app.

Model validation for field ranges using yii2-field-range extension

Created 3 months ago by Kartik VTips0 comments – viewed 1,596 times – ( +29 ) – version 2.0
The yii2-field-range extension enables you to easily setup ActiveField range fields with Bootstrap styling. You basically can setup two attributes joined together like a single field with combined validation error block.

Adding Yii Search to Your Browser Search Box

Created 3 years ago by qiangTips1 comment – viewed 31,706 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 10,439 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 24,403 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.