Wiki

Sorted by commentsX
Displaying 61-70 of 470 result(s).

Setting and maintaining the language in Application (i18n)

Created 4 years ago by olafureTutorials9 comments – viewed 48,110 times – ( +19 )
As seen in this post, Yii doesn't enforce how language is set and maintained within the session.
tags: i18n, translation

Manage (Target) Language in Multilingual Applications + A Language Selector Widget (i18n)

Created about a year ago by c@cbaTutorials9 comments – viewed 14,675 times – ( +9 )
In case of a multilingual application, one might consider it a reasonable approach to store the preferred language of the user in a session variable, and after that, every time a page is requested, to check this session variable and render the page in the indicated language. This tutorial shows a Yii-way of doing this. We implement an event handler for the onBeginRequest event; as the name of the event suggests, this event handler will be called at the beginning of each request, so its a good place to check whether a language is provided (via post, session or cookie) and set the application language accordingly. We also implement a simple Language-Selector Widget, which can render the language options as ajax-links or as a drop-down list.

Add information to Yii::app()->user by extending CWebUser

Created 3 years ago by atrandafirTutorials9 comments – viewed 54,486 times – ( +27 )
This little tutorial explains a way how you can retrieve more parameters from Yii::app()->user by adding a component that extends CWebUser and retrieves the user information from database table named User.

Display an AJAX tree from your DB using CTreeView

Created 3 years ago by François GannazTutorials9 comments – viewed 26,970 times – ( +20 )
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 upload image(photo), and path entry in database with update functionality

Created 10 months ago by kiran sharmaTips9 comments – viewed 30,725 times – ( +19 )
I saw many posts that community newbie is confuse in image/photo upload with random name. so I post this topic covering all useful things regarding to image/photo upload(not covering image attribute related functionality)

Drills : Search by a HAS_MANY relation

Created 5 months ago by softarkTutorials9 comments – viewed 7,854 times – ( +20 )
Sometimes we get lost trying to search by a HAS_MANY relation using CActiveRecord or CActiveDataProvider. This article is a series of drills that try to describe the practical techniques of searching by a HAS_MANY relation.

Implementing a User Level Access System

Created 2 years ago by Antonio RamirezTutorials9 comments – viewed 26,407 times – ( +27 )
I would like to provide you a quick tip on how to implement user level access to your Yii applications.

Local time zones and locales

Created 2 years ago by Russell EnglandHow-tos9 comments – viewed 30,432 times – ( +12 / -2 )
Following on from international dates, I also wanted times in the local timezone and format. This was a little more tricky but I think I've got a solution. This is only really appropriate if you have an international app.

How to show ajax delete status in CGridView like flash messages

Created about a year ago by hasanaviHow-tos9 comments – viewed 18,724 times – ( +16 )
I've seen many tickets regarding how to show friendly delete confirmation using CGridView's CButtonColumn in ajax request. If you are using relational database, after producing CRUD functionality when you try to delete a record in ajax mode which has child record it can't be deleted and you can see the ajax loader forever. By this way you can't show the users if a record has been successfully deleted or if there are some problem in flash style (setFlash() / getFlash())

CGridView: Render customized/complex datacolumns

Created about a year ago by JobloTips8 comments – viewed 57,830 times – ( +56 )
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