Wiki

Articles in category "tutorials", sorted by viewsX
Displaying 51-60 of 249 result(s).

How to display static pages in Yii?

Created 7 years ago by qiangTutorials2 comments – viewed 58,468 times – ( +19 ) – version 1.1
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

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 4 years ago by c@cbaTutorials3 comments – viewed 57,390 times – ( +28 / -1 ) – version 1.1
    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this: 'value'=>'$data->author->username',.     Now we might want to use $data in the declaration of the htmlOptions attribute, which is normally not possible, to generate for example the tag <td id="3" class="name_3">, where 3 is the id of the data model for the current row, i.e. $data->id. That is, we want to be able to use: 'htmlOptions'=>array('id'=>'$data->id', 'class'=>'"name_{$data->id}"')     Here's a way to accomplish this...

Yii and XAMPP server on Windows

Created 5 years ago by TrejderTutorials0 comments – viewed 57,016 times – ( +3 ) – version 1.1
This article explains issues about installing XAMPP server package (Lite version) on Windows OS and configuring it for serving webapps written in Yii. Please note, that XAMPP is available for many more platforms and systems. I write about Windows edition as it was the only one tested by me.
tags: windows, xampp, server

Displaying, sorting and filtering HasMany & ManyMany relations in CGridView

Created 3 years ago by yJeroenTutorials8 comments – viewed 55,613 times – ( +21 ) – version 1.1
This tutorial gives you multiple options of how to fully implement showing, sorting and filtering related data in gridviews.

SEO-conform Multilingual URLs + Language Selector Widget (i18n)

Created 4 years ago by c@cbaTutorials37 comments – viewed 55,593 times – ( +32 ) – version 1.1
You have a multilingual application, and you want the URL of a page to be different for different languages, to account for SEO. The URL for the contact page for example should look like http://something.com/en/contact in english, and http://something.com/de/contact in german. This tutorial describes how to make it happen. Note that currently selected language is always a part of the URL, and thus available to the application through $_GET. You don't have to use sessions variables to keep track of the language if you don't want to.

How to hide index.php on nginx

Created 7 years ago by milesTutorials3 comments – viewed 55,270 times – ( +4 ) – version 1.1
For a complete sample Nginx+PHP-FPM config, view this how-to: Nginx & PHP-FPM
tags: URL

Module based login

Created 5 years ago by suriyansureshTutorials6 comments – viewed 55,183 times – ( +14 ) – version 1.1
If you want to add module based login to a site without using RBAC, please follow these guidelines.

Display an AJAX tree from your DB using CTreeView

Created 6 years ago by François GannazTutorials10 comments – viewed 54,752 times – ( +21 ) – version 1.1
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

How to add ajax-loading indicators

Created 6 years ago by schmunkTutorials5 comments – viewed 52,882 times – ( +27 ) – version 1.1
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

Working with radiobutton list

Created 4 years ago by vibhaJadwaniTutorials3 comments – viewed 51,365 times – ( +10 ) – version 1.1
This is a tutorial to work with radioButtonList which will handle enum datatype. Form design and validation both are detailed here.