Wiki

Articles in category "tips", sorted by commentsX
Displaying 81-90 of 134 result(s).

htmlOptions explained for various controls.

Created 3 years ago by WoilTips1 comment – viewed 41,685 times – ( +17 ) – version 1.1
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:

Functional tests independing from your urlManager settings

Created 3 years ago by RusAlexTips1 comment – viewed 7,413 times – version 1.1
If you are testing your app and use urlManager in your config, sometimes you will find a problem: you want to test your site independing from urlManager settings. in that way you need to extend your WebTestCase class by this method:

Making friends' configs, DB credentials and paths with version control

Created about a year ago by Alexander PalamarchukTips1 comment – viewed 4,930 times – ( +2 / -1 ) – version 1.1
In many cases developers of one project use their own local environments for coding. There may be a common test platform and, of course, production. All these environments usually have different DB credentials and directory structures (first of all, path to YII framework directory). Another feature is debugging. It's convenient to turn it on for local environments, eventually - on the test server and never (generally speaking) - on the production.
tags: config

Yii2 default values for Index data Provider

Created 4 months ago by CTalaTips1 comment – viewed 1,418 times – ( +1 ) – version 2.0
Guys,

URL component access functions

Created 3 years ago by Steve FriedlTips1 comment – viewed 10,440 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

A simple action for XUpload extension

Created 3 years ago by tydeas_drTips1 comment – viewed 12,887 times – ( +3 ) – version 1.1
All the basic functionality for an action used by the xupload extension. Check resources for the source code of this action
tags: tips, xupload, caction

PHPStorm & NetBeans autocomplete problem

Created about a year ago by StagelineTips1 comment – viewed 7,715 times – ( +22 ) – version 1.1
The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.

View a related field in CGridView

Created 2 months ago by Rafael J TorresTips1 comment – viewed 1,533 times – ( +5 ) – version 1.1
Generally we need to show one or more fields from a model that is related to another model used in CGridView. For our case we will use two related models, which explain how to use model "A" fields in a CGridView that used model "B".

using jqbargraph to create beautiful graphs

Created about a year ago by MAHESH.E.UTips1 comment – viewed 5,528 times – ( +5 ) – version 1.1
If you are about to create a graph, the best option i would suggest is the jqbargraph.

CjuiDatepicker

Created about a year ago by hiral darjiTips1 comment – viewed 5,457 times – ( +3 ) – version 1.1
If you have two datepicker in one form and you want that a date of from date shold be minimum date of todate then put following code in Cjuidatepicker widget options array: