Wiki

Articles in category "how-tos", sorted by viewsX
Displaying 31-40 of 342 result(s).

How to translate and do the translations the easy way

Created 3 years ago by Roman SolomatinHow-tos3 comments – viewed 53,887 times – ( +28 / -2 ) – version 1.1
I wanted to keep all the I18N related translations in separate files, so that I would not need to modify the view files or the model files every time I need to update or fix the translations of application's source language.

Displaying image in a CGridView column.

Created 3 years ago by sirin kHow-tos5 comments – viewed 52,647 times – ( +13 / -1 ) – version 1.1
This is a simple example of how we can display images in CGridviews.Imagine that you have an image field in your table ie either a location field or a blob type field used to store the images.
tags: CGridView, image

Using setFlash for displaying various kind of messages

Created 4 years ago by TrejderHow-tos6 comments – viewed 51,774 times – ( +4 / -5 ) – version 1.1
In this short how-to I will show how to customize setFlash() to display messages (flashes) styled to be success confirmation, error report or notice information. And how to achieve displaying errors in other way.
tags: flash, error, message

Updating fields on a form with Ajax and Json

Created 4 years ago by Russell EnglandHow-tos4 comments – viewed 50,095 times – ( +12 / -1 ) – version 1.1
I'm developing a website that has an option to look up a car's registration number via SOAP and return additional details such as make, model, colour etc.

Using Yii with Nginx and PHP-FPM

Created 4 years ago by LericHow-tos10 comments – viewed 48,832 times – ( +18 ) – version 1.1
This config is built on an Ubuntu 11.04 server. Software is nginx, php-fpm (php5-fpm). For performance, it's recommended to run php-fpm in SOCKET mode, instead of accessing via IP:PORT. That is the method shown below.

X-Sendfile - serve large static files efficiently from web applications

Created 4 years ago by Maurizio Domba CerinHow-tos5 comments – viewed 47,941 times – ( +26 ) – version 1.1
Normally when we want users to download a file, that file is put in a folder under the web application root and the web server does the rest.

How to write a simple application component

Created 4 years ago by zaccariaHow-tos5 comments – viewed 46,477 times – ( +20 / -7 ) – version 1.1
An application component is a confortable way for share information among all component of the application

How to use single form to collect data for two or more models (CActiveForm and Ajax Validation edition)

Created 4 years ago by RusAlexHow-tos9 comments – viewed 46,262 times – ( +22 ) – version 1.1
With Yii you can use one CActiveForm for collecting data for two or more models with ajax validation and client validation.

How to avoid multiple Ajax Request

Created 4 years ago by nickcvHow-tos26 comments – viewed 45,927 times – ( +25 / -2 ) – version 1.1
CHtml::ajaxLink(), CHtml::ajaxSubmitButton() and similar methods are great, but if they are located inside a portion of the page that is already loaded via ajax something bad will happen, something you may even not notice if you are not using tools like firebugs: the sent ajax requests will multiply themselves.

Moving project code outside of webroot (plus multiple project support)

Created 4 years ago by Steve FriedlHow-tos8 comments – viewed 43,682 times – ( +22 / -1 ) – version 1.1
Yii's by-default directory organization works well enough, but there are several steps one can take that improve the security and serviceability of the system, especially in the context of multiple Yii projects on the same machine (including multiple versions of the same project).
tags: config, security