Re: [PHP] Simple objective which always seems to make me think I'm doing it wrong.

[email protected] (Matijn Woudt)
Newsgroups php.general
Message-ID <CAC_gtuNMnSSTG4+1AXwN9sWcaAk9SSvcwEFSpsho5uCVgRS6AA@mail.gmail.com>
On Thu, May 23, 2013 at 4:54 PM, Richard Quadling <[email protected]>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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.