On Wed, May 02, 2001 at 05:33:46AM +0200, Gerald Richter wrote:
>
>
> Your files (that are invoked via Execute ('*') ), defines a method, for
> example getstatus, this method returns what ever information is needed, your
> status page now can call this method, also the actual file isn't executed so
> far:
>
> status.epl:
>
> [-
> $r = shift ; # get EMbperl request object
> $status = $r -> getstatus ; # retrived status of current page
> -]
>
> in your page:
>
> [!
> sub getstatus
> {
> return "What ever you want" ;
> }
> !]
>
The above works perfectly however it doesn't work in my project since I have all my
functions in a seperate file.
I tried doing this in my page:
[- $subs = $param[0] -]
[! sub getstatus { return $subs->status } !]
But unfortunately I get the following error message: 'Can't call method "status" on an
undefined value at....'
Is there some other way I can separate my functions from the individual pages and get
an accurate status. Or am I going in the totally wrong direction and should I instead
do things with plain Embperl instead of EmbperlObject????
Thanks for any suggestions,
Nico
>
>
> > Nico
> >
> > >>
> > >> Is there a way to force Embperl to execute the * portion first? How
> have others solved this problem?
> > >>
> > >
> > >You can use method calls to solve this problem. Look at the example in
> the EMbperlObject documenation:
> > >
> >
> >http://perl.apache.org/embperl/EmbperlObject.pod.5.html#Example_for_using_m
> ethod_calls
> > >
> > >This example shows different things. The piece that apply to your
> problem, is how the title is build. The actual file defines a method title,
> that could be call _before_ the Execute ('*')
> > >
> > >Hope this helps
> > >
> > >Gerald
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]