[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Open and 'run' a page from within another page?
marc.brevoort [marc.brevoort@armazemdedados.com] wrote:
>
> Back when I used PHP, it was possible to load a page from another
> one by telling it require(pagename) require_once(pagename).
>
> Interchange allows for something similar using the tags
> include(filename) or file (filename). However I've run into a
> problem here.
>
> * If I use the file tag (with interpolate=1) to include a file,
> perl tags in the included page are properly executed, but
> variables such as __UI_BASE__ are untouched.
>
> * If I use the include tag, (with interpolate=1), __UI_BASE__ is
> properly interpolated, but now the perl tags stop giving any
> output. According to the documentation, the include tag should
> interpolate all tags and variables.
>
> (The error log does not show any errors as long as I don't
> attempt to use the header template, I suspect the perl tags
> are blocked by Safe but I'm not sure).
>
> How can I run a page from within another page, and make it act
> in the same way it would when running stand-alone?
>
Put this in a file:
Var check: __SOME_VARIABLE__<br>
Tag check: [time]%Y[/time]<br>
Perl check: [calc] return 'Hello world'; [/calc]<br>
Then call with [include]. You should find that it all works. If it
doesn't then perhaps there's something wrong with the contents of your
file.
You shouldn't be using interpolate=1 with [include], by the way.
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/