Re: Object-oriented $_REQUEST?

From: Date: Sat, 28 Apr 2007 20:53:17 +0000
Subject: Re: Object-oriented $_REQUEST?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-254078@lists.php.net to get a copy of this message
""Buesching, Logan J"" <ljbuesch@purdue.edu> schrieb im Newsbeitrag news:1FD02EA2D6CD404E9FD7E866C19714D43EDE9B@EXCH05.purdue.lcl... I feel that a 'request' class wouldn't be appropriate for the $_REQUEST array. The reason being, is that there isn't to that class other than the $_REQUEST array, and a bunch of 'get' methods. If this were to be expanded upon by adding filtering user input, then it *could* be more useful. IMO an entire class just to handle retrieving data an array (or 4 if you include GPC and request) would become unnecessary overhead. But then again, maybe I am missing the point of this 'request' class. -Logan > -----Original Message----- > From: js [mailto:ebgssth@gmail.com] > Sent: Saturday, April 28, 2007 2:56 PM > To: php-general@lists.php.net > Subject: [PHP] Object-oriented $_REQUEST? > > Hi. > > I'm looking for implementation of request object > that represent a request that works like this. > > $r = new request(); > if ($r->method == 'GET') > $name = $r->GET->get('name'); > $age = $r->GET->get('age'); > else if (request.method == 'POST') > $name = $r->POST->get('name'); > $age = $r->POST->get('age'); > ... > > Handling $_GET, $_POST directly is cumbersome for me > so I tried to make one but I thought it's quite possible that > some better programmer already make one like this. > > Thanks in advance. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#254078) next »