Re: Structuring large PHP programs
| From: | Michael Kimsal | Date: | Thu, 15 Feb 2001 02:07:15 +0000 |
| Subject: | Re: Structuring large PHP programs | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39794@lists.php.net to get a copy of this message | ||
Any particular reason you don't do something like:
$whatever="blah";
include($whatever);
This eliminates the need for potentially dozens of case/switch statements.
If you're interested, we're developing a more structured way of handling
this with classes, and I could demonstrate some of this to you and/or send
you
code examples.
John McCreesh wrote:
> What is the best practice for structuring a PHP program which is
> becoming too large to manage as a single file? Should it be broken into
> a number of includes, e.g.:
>
> switch ($whatever) {
> case 0:
> include('case0.php');
> break;
> case 1:
> include('case1.php');
> break;
> case 2:
> include('case2.php');
> break;
> }
>
> or a number of functions:
>
> require('mylib');
> switch ($whatever) {
> case 0:
> case0();
> break;
> case 1:
> case1();
> break;
> case 2:
> case3();
> break;
> }
>
> Any thoughts, references to articles (couldn't find anything in
> PHPBuilder), etc gratefully received...
>
> Thanks - John
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net