Re: Simple objective which always seems to make me think I'm doing it wrong.
| From: | Matijn Woudt | Date: | Thu, 23 May 2013 15:24:02 +0000 |
| Subject: | Re: Simple objective which always seems to make me think I'm doing it wrong. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-321175@lists.php.net to get a copy of this message | ||
On Thu, May 23, 2013 at 4:54 PM, Richard Quadling <rquadling@gmail.com>wrote:
> Hi.
>
> I'm building an XML file.
>
> It is within an OOP structure and is pretty simple.
>
> The method is ...
> <snip>
>
> Nothing particularly difficult to understand, but I just don't like having
> the XML embedded this way.
>
> Ideally, I want a scope aware include function, so I can say _something_
> like ...
>
> $s_XML = require_once __CLASS__ . DIRECTORY_SEPARATOR .
> 'normalisedError.xml';
>
> and have the include be aware of the local scope (so $o_XML and $this are
> all happy).
>
> I know I can write a template parser, but I'm just missing an obvious
> solution that isn't fat and doesn't require a massive learning for the
> other devs.
>
> Ideas?
>
> Thanks for reading.
>
> Richard.
>
>
What is wrong with the require_once? I don't see why it would not work.
- Matijn