Matthew Weier O'Phinney-3 wrote: > > First, you _can_ use the $_request property directly. However, if you > ever modify getRequest() in your class or in a custom base controller > class, then you may be accessing the wrong property or overriding > necessary business logic. For this reason, we recommend using > getRequest() to grab the request object. (This is good OOP practice, > btw.) > I understand that, and I am OK with it (and I welcome all the new features added like the params stuff), but the example I gave is with $_SERVER and not $_REQUEST. And it is a good OOP practice, but in this case is a way too much for something so simple.
Matthew Weier O'Phinney-3 wrote: > > Next, using isPost() is more portable than using > $_SERVER['REQUEST_METHOD']. The reasons are that your web server may or > may not populate this environment variable, and for testing. With > testing, we allow you to specifically set the request method -- $_SERVER > is never modified in this case. This gives you the ability to test your > applications without needing a web server involved. > I see, it's cool. -- View this message in context: http://www.nabble.com/%24this-%3EgetRequest%28%29-%3EisPost%28%29-vs.-%28%24_SERVER-%27REQUEST_METHOD%27--%3D%3D-%27POST%27%29-tp19185079p19199833.html Sent from the Zend Framework mailing list archive at Nabble.com.