I just read this 
http://weierophinney.net/matthew/archives/184-Speaking-at-ZendCon-2008.html
blog post  from Matthew, and saw the link to the QuickStart:

*  http://framework.zend.com/wiki/display/ZFDEV/Official+ZF+QuickStart
http://framework.zend.com/wiki/display/ZFDEV/Official+ZF+QuickStart 

I found something that I find disturbing. In the form handler, I saw this:

if ($this->getRequest()->isPost()) {...

(this is in the 
http://framework.zend.com/wiki/display/ZFDEV/Official+ZF+QuickStart#OfficialZFQuickStart-BuildaForm
Build a Form  section)

Isn't this a little too overcomplicated ? I also like the well-arranged and
tidy OOP syntax, but this seems too much for me. I don't mean to criticize,
but I want to figure out what's the logic behind a line of code like that.
What would justify the extra cycles for stacking the function calls, and
passing the request object, against plain old "equals" check , like:

if ($_SERVER['REQUEST_METHOD'] == 'POST') { ...

I understand that there are a lot of ways to do a job, but in this case this
doesn't seem like a "best practice" to me.

What do you think ?
-- 
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-tp19185079p19185079.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to