Yii Framework Forum: In Yii You Can Access The $_Request , $_Post , $_Get Variables Directly Or Use The Getparam. - Yii Framework Forum

Jump to content

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

In Yii You Can Access The $_Request , $_Post , $_Get Variables Directly Or Use The Getparam. Rate Topic: -----

#1 User is offline   Lloyd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 08-November 12

Posted 08 February 2013 - 06:51 PM

Hi,

In Yii you can access the $_REQUEST , $_POST , $_GET variables directly or use the getParam.

I understand that getParam really does is use those arrays directly anyway, but with the difference that if the param doesn't exist it returns null by default, or a value that you specify as the second argument to the getParam call.

My question is that in many wiki articles, forum posts, Yii books, and articles available on the net, the example code does not make use of the getParam method, but instead uses the $_REQUEST , $_POST , $_GET to
access the variables.

Is there times when you should not use the getParam, and if so, what are they.

Thanks


Lloyd
0

#2 User is offline   Luke Jurgs 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 16-October 11
  • Location:Australia

Posted 08 February 2013 - 07:25 PM

It really just boils down to personal preference. I like getQuery/Post/Param for the default value facility and the way it looks in my code.
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