Showing 421-440 of 652 items.

Authenticating against phpass hashes with Yii

Created 14 years ago by Da:Sourcerer Da:Sourcerer, updated 12 years ago by Da:Sourcerer Da:Sourcerer. 18 comments
  • iteration_count_log2 controls the number of iterations for key stretching. A setting of 8 means the hash algorithm will be applied 2^8 = 256 times. This setting should be kept between 4 and 31.
  • portable_hashes controls whether portable hashes should be used or not. Portable hashes are salted MD5 hashes prefixed by $P$.
22 0
28
Viewed: 45 782 times
Version: 1.1
Category: How-tos

Avoiding duplicate script download when using CActiveForm on Ajax calls

Created 14 years ago by Antonio Ramirez Antonio Ramirez, updated 14 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 2 comments

The only thing required is simple, we just need to create a view that will be partially rendered by a call to a controller (using renderPartial) and make sure that we process output -setting to true the parameter on the function. Everything will work as expected but...

11 1
9
Viewed: 30 753 times
Version: 1.1
Category: Tutorials

Customizing Yii's formatting rules (extending CFormatter)

Created 15 years ago by Haensel Haensel, updated 15 years ago by Haensel Haensel. 0 comments

CFormatter is one of Yii's core components and used to format values displayed in widgets like CGridView or CDetailView. All classic formats like numbers, text, urls or datetime are supported but you may have to use a formatting rule that isn't built in. Let's say we want to display arrays of strings (like tags associated with a product model)...

12 0
6
Viewed: 25 584 times
Version: 1.1
Category: Tips

Display a nice exception message on ajax requests

Created 15 years ago by Maurizio Domba Cerin Maurizio Domba Cerin, updated 15 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 3 comments

in Yii versions previous to 1.1.9 exceptions was handled differently during ajax request and displayed by CApplication::displayException(). This way the exception message displayed on ajax requests could not be customized.
The message for the CGridView delete request with YII_DEBUG set to true l...

12 0
19
Viewed: 53 006 times
Version: 1.1
Category: Tips

Using a CDbDataReader (sql query result) in a zii widget (such as CGridView or CListView)

Created 15 years ago by Revelis Luc Bonnin Revelis Luc Bonnin, updated 15 years ago by Revelis Luc Bonnin Revelis Luc Bonnin. 2 comments

If in your application you have to proceed to a complex SQL query that is not associated to a model, you will use CDbDataReader like it is described in the Yii documentation. An example could be