Re: Include file must be valid
| From: | Zeev Suraski | Date: | Sat, 29 Jul 2000 21:29:48 +0000 |
| Subject: | Re: Include file must be valid | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8993@lists.php.net to get a copy of this message | ||
At 20:36 28/07/2000, Simon Biela wrote:
But this issure is not really helpful for developers. The documentation says, that include just pulls the content of the file into the other file. I don't want that file to be evaluated for itself.Well, you got to rely on a very 'ugly' feature which was an implementation side-effect of PHP 3.0. I truly believe that this *is* helpful for developers, because it prevents you from dividing your code into modules in an extremely incorrect manner.
The example I gave, is a help for people who don't understand how to create a while structure but want to use it. Instead of writing while ($output[something][$i]) { or even something more complex, they just have to write include(whilestart) What other possibility do I have to solve this problem?You can do all that quite easily. Just think about a different way to implement it - have your template files include the end users' code, instead of the other way around. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/