Yii Framework Forum: Tooltips & error reporting - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Tooltips & error reporting Rate Topic: -----

#1 User is offline   StErMi 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 259
  • Joined: 30-March 09

Posted 23 June 2009 - 10:17 AM

This is a weak part of Yii ( imho ).

Tooltips

Every model has an attributeLabels() function to generate customized a input field label.

I think that Yii need a inputTooltips() function to generate a customazed tooltip for each input field that we have.
Like many people know we have a good library that use jQuery that has many features ( included tooltips ): http://flowplayer.or...oltip/form.html

Error reporting

At this moment we can use CHtml::errorSummary($model); to print the summary of errors for this model.

I think that a better way is to put a permanent red tooltip near the the field that has an error to make the error message related the input field cleaner than now.
Another way is to put an error icon right near the input field and onOver show the tooltip with the error message related to that field.

What do you think about? I know that Yii want to leave the core code small but I think that these are some must-have-point for a good framework. Maybe I will do some extensions for this but before I want to know your opinions.
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,871
  • Joined: 04-October 08
  • Location:DC, USA

Posted 23 June 2009 - 11:20 AM

This can be implemented by extending CActiveRecord to provide such a method. And then all your other AR classes extend from this base class.

The reason that we don't want to include this into the core is because there could be other similar requests that would bloat the CActiveRecord class eventually.

Also, the tooltips are more suitable to be classified as presentational elements, which do not belong to model (label is special because we need it everywhere to name an attribute).
0

#3 User is offline   StErMi 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 259
  • Joined: 30-March 09

Posted 23 June 2009 - 12:03 PM

Why have I to extend CActiveRecord ? ( i mean, why CActiveRecord )
0

#4 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,871
  • Joined: 04-October 08
  • Location:DC, USA

Posted 23 June 2009 - 08:12 PM

Sorry for misunderstanding. Did you try using CHtml::error()?
0

#5 User is offline   jonah 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 733
  • Joined: 27-November 08
  • Location:California (US)

Posted 24 June 2009 - 03:13 PM

I agree, inputTooltips() is too application-specific.  You may extend Yii yourself to allow for this functionality (as qiang said, I would extend CActiveRecord, and also CHtml)
0

#6 User is offline   rajesh chaurasia 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 12-January 13
  • Location:Mohali

Posted 10 June 2013 - 06:10 AM

hi friends you can use tooltip in your form like

echo $form->textFieldRow($model,'email',array('rel'=>"tooltip", 'title'=>'if you are employer than please enter your company email'));

if you are using booster.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users