Yii Framework Forum: Bad Idea To Use Get_Defined_Vars() With Partial Views? - Yii Framework Forum

Jump to content

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

Bad Idea To Use Get_Defined_Vars() With Partial Views? Rate Topic: -----

#1 User is offline   danschmidt5189 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 19-February 13

Posted 19 June 2013 - 05:25 PM

Sometimes I embed a customizable partial view inside of another view. In these cases, it can be a pain to pass all the view parameters individually.

Is it a bad idea to just pass all the available variables to the partial view? E.g.:
$this->renderPartial('_subView', get_defined_vars());

0

#2 User is offline   Fabrizio Caldarelli 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 274
  • Joined: 21-March 13
  • Location:Rome, Italy

Posted 19 June 2013 - 05:42 PM

Do you really need all your variables in your view?
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