E
E
evilelf2015-05-13 20:54:57
Yii
evilelf, 2015-05-13 20:54:57

Email protected instead of email, how to fix it?

$user = Users::model()->findAll();
echo CHtml::dropDownList('MoneyPlayerReset[]', '', CHtml::listData($user, 'ID', function($u){ return CHtml::encode($u->email); }), array( 'multiple'=>true, 'empty'=>'All', 'size'=>10 ));

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
evilelf, 2015-05-13
@evilelf

In general, I removed @ and everything was fine)
But why such a reaction to @?)

echo CHtml::dropDownList('MoneyPlayerReset[]', '', CHtml::listData($user, 'ID', function($u){ return CHtml::encode(str_replace('@', '', $u->email)); }), array( 'multiple'=>true, 'empty'=>'All', 'size'=>10 ));

A
Alexander, 2015-05-13
@liff

echo CHtml::dropDownList('MoneyPlayerReset[]', '', CHtml::listData($user, 'ID', 'email'), array( 'multiple'=>true, 'empty'=>'All', 'size'=>10 ));
encode is not needed, because it is applied by default for dropDownList

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question