RE: [PHP] Object-oriented $_REQUEST?
| From: | Buesching, Logan J | Date: | Sat, 28 Apr 2007 19:28:56 +0000 |
| Subject: | RE: [PHP] Object-oriented $_REQUEST? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254068@lists.php.net to get a copy of this message | ||
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