Wiki

Articles in category "tips", sorted by commentsX
Displaying 91-100 of 147 result(s).

Yii 2 list of path aliases available with default basic and advanced app.

Created 11 months ago by Kartik VTips1 comment – viewed 16,917 times – ( +40 / -5 ) – version 2.0
If you are coming over from Yii 1.x to Yii 2, and already read this guide, you may note that namespaces are very important in Yii 2 to identify classes. But do you know the list of seeded path aliases that come shipped with a basic or advanced app? Here is my attempt to list them.

URL component access functions

Created 4 years ago by Steve FriedlTips1 comment – viewed 11,171 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 4 years ago by tydeas_drTips1 comment – viewed 13,786 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

View a related field in CGridView

Created 10 months ago by rafaelt88Tips1 comment – viewed 4,964 times – ( +6 ) – 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 2 years ago by MAHESH.E.UTips1 comment – viewed 6,410 times – ( +5 ) – version 1.1
If you are about to create a graph, the best option i would suggest is the jqbargraph.

CjuiDatepicker

Created 2 years ago by hiral darjiTips1 comment – viewed 6,161 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:

Search scenario (CGridView, etc.): avoid default values from database as search condition.

Created 9 months ago by le_topTips1 comment – viewed 2,790 times – ( +1 ) – version 1.1
Yii has a neat "trick" that will assign default values to new CActiveRecords. When performing a search() though, this is pretty annoying as they automatically apply as filter values.

How to use a component before every action of a controller

Created 2 years ago by transistorTips1 comment – viewed 21,862 times – ( +2 / -1 ) – version 1.1
I guess this is a tip on how to execute some code before every action in a controller, because I will tell you how I did it and maybe you can use the idea in your project.

Provide SVG when the browser supports it, else PNG (using CHtml::image overload)

Created 5 months ago by le_topTips0 comments – viewed 2,026 times – ( +1 ) – version 1.1
Modern browsers support SVG, older browsers do not. This replacement for CHtml::image() allows you to handle to propose SVG in an efficient way with PNG as a fallback.

Analyse the server's USER-AGENT against browsecap file to determine it's capability.

Created 5 months ago by Deepak PradhanTips0 comments – viewed 1,691 times – version 2.0
Does your application need to know user's details on browser details, os and device type? We can use PHP's misc. function to achieve that provided you have an update copy of browsercap.ini