Re: Object-oriented $_REQUEST?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For me, PHP's issetting or emptying $_GET, $_POST or $_REQUEST is cumbersome.
want it to be more easy and comfortable.

I could say I want a JSP's HttpServletRequest for PHP.
(http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletRequest.html)

I think you're 100% right that it would become slow
but using this one is a 'option', not mandatory.
so i think that's not a matter.

thank you.


On 4/29/07, Buesching, Logan J <ljbuesch@xxxxxxxxxx> wrote:
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@xxxxxxxxx]
> Sent: Saturday, April 28, 2007 2:56 PM
> To: php-general@xxxxxxxxxxxxx
> Subject:  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



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux