Wiki

Displaying 191-200 of 470 result(s).

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

Created about a year ago by c@cbaTutorials9 comments – viewed 14,670 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.

Secure password hashing with bCrypt

Created about a year ago by waitforitHow-tos3 comments – viewed 11,121 times – ( +6 )
In this article I will show you how to implement a secure password hashing mechanism in your Yii projects using a bCrypt class.

Update two models with one view

Created about a year ago by sensorarioTips10 comments – viewed 18,665 times – ( +10 / -2 )
Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).
tags: database, model, view, form

Change buttons on our CGridView extending yii

Created about a year ago by sensorarioTips4 comments – viewed 13,663 times – ( +9 )
In this tip, I'll help you to change in few second buttons of your CGridView. I hope you like it =).

Use application on production/development environment without making changes

Created about a year ago by ifdatticTips2 comments – viewed 16,147 times – ( +8 / -1 )
I like programing on my localhost, however it really bugged me to make changes to index.php & config files on my production server. After combining all available wiki articles on this topic and some trial and error this is what I use for my applications so I could just upload it to production server and it will work without any changes.

Managing constants easily

Created about a year ago by briiC.lvTips4 comments – viewed 6,175 times – ( +4 )
For time to time i have models with constants (basicly status constants) which i use in diferent places and if these constant changes, i have to change mentions of constant in code elsewhere.

Front-end developer's guide

Created about a year ago by jonahTutorials5 comments – viewed 15,464 times – ( +10 )
This wiki is a work in progress.

The Comedy of Errors

Created about a year ago by fsbOthers3 comments – viewed 5,151 times – ( +18 )
Please join the party by adding your own favorite Yii programming errors. Be sure to leave at least a hint at the correction.

Accessing data in a join table with the related models

Created about a year ago by fsbHow-tos7 comments – viewed 36,337 times – ( +18 / -1 )
Sometimes the right place to store application data is in a join table. For example, movie viewers either like or don’t like the movies they watched.

Rendering a view file in a console application

Created about a year ago by TompiHow-tos1 comment – viewed 4,386 times – ( +2 )
When someone want to send formatted HTML mails from a console application she/he will probably come across the problem of rendering view files.