Yii Framework Forum: CHtml::errorSummary support for multiple models - Yii Framework Forum

Jump to content

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

CHtml::errorSummary support for multiple models Rate Topic: -----

#1 User is offline   ShabbyRobe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 13-October 08

Posted 16 October 2008 - 08:58 PM

In my application, I have a view which takes input for two related active record models, however when I validate them I can only pass one of them to an error summary, so I have to have two error summaries like so:


<?php echo CHtml::errorSummary($model1); ?>
<?php echo CHtml::errorSummary($model2); ?>


The problem is that I get two "Please fix the following input errors:" headings when I really only need the one.

If CHtml::errorSummary could take a CModel or an array of CModels as its first parameter, and in the latter case just loop, it would cater for this.
0

#2 User is offline   qiang 

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

Posted 16 October 2008 - 09:54 PM

Done.
1

#3 User is offline   ShabbyRobe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 13-October 08

Posted 16 October 2008 - 09:57 PM

So fast, again!! This is shaping up to be a fantastic framework.
0

#4 User is offline   qiang 

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

Posted 16 October 2008 - 10:10 PM

Thanks for raising suggestions and finding bugs.
I hope Yii could get stable as soon as possible so that we release beta and formal versions soon.
0

#5 User is offline   ShabbyRobe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 13-October 08

Posted 16 October 2008 - 10:13 PM

I hope you don't mind if I keep them coming - I'm quite enjoying playing with Yii as it is forcing me to think about things in different ways, a lot of which I quite like.
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