Re: Newbie - Request interface for PHP 5 website
| From: | Greg Donald | Date: | Fri, 03 Jun 2005 12:38:06 +0000 |
| Subject: | Re: Newbie - Request interface for PHP 5 website | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-216308@lists.php.net to get a copy of this message | ||
On 6/2/05, Info@Best-IT <info@best-it.biz> wrote:
>
> For PHP 4.x sites I used my index page to capture the HTTP request and use a
> switch statement to call the content or task based on the $_GET and $_POST
> arrays. That was very inefficient and the Switch case became totally
> unmanageable along with the rest of the site.
>
> I am re-designing the site using PHP5 and OO design patterns like Composite
> and Builder as an example. I know these are basic patterns but its a start.
> Anyway I am not sure how to capture the HTTP request and pass it to the
> relevant objects. Is there a generic Œway¹ developers process the request
> to call the classes and generate the needed objects in PHP5?
I'd use $_REQUEST if I were expecting to access both $_GET and $_POST
arrays frequently/equally.
__autoload() is pretty handy, keeps you from writing tons of include statements.
--
Greg Donald
Zend Certified Engineer
http://destiney.com/