Hi,
Perhaps the following question only derives from a basic misunderstanding
by a poor perlOO newby. If so I beg your pardon!
I tried to use EmbperlObject with inheritance by modifying "The Example
for using method calls" in Geralds docu. I were able to overwrite some
methods in "sub/page2.epl" by holding some others from "base.epl" at them
same time. I failed while trying the same with properties: In "page2.epl"
I set a new property '$self -> {test} = "blafasel"' which implicated that
everything set in "base.epl" ($self -> {fontsize}; $self -> {fontcolor};
...) is no longer available. Where am I wrong?
Volker
------------------------------->8----(base.epl)----------------------
[!
sub new
{
my $self = shift ;
# here we attach some data to the request object
$self -> {fontsize} = 2 ;
$self -> {fontcolor} = "red" ;
}
# Here we give a default title
sub title { 'Title not given' } ;
sub headline { 'Headline not given' } ;
!]
[-
# get the request object of the current request
$req = shift ;
# here we call the method new
$req -> new ;
-]
<html>
<head>
<title>[+ $req -> title +]</title>
</head>
<h1>[+ $req -> headline +]</h1>
<body>
[- Execute ('head.epl') -]
[- Execute ('*') -]
[- Execute ('foot.epl') -]
</body>
</html>
------------------------------->8------------------------------------
------------------------------->8----(page2.epl)---------------------
[!
sub new
{
my $self = shift ;
# here we overwrite the new method form base.htm
# $self -> {fontsize} = 5 ;
# $self -> {fontcolor} = "green" ;
$self -> {test} = "blafasel" ;
}
# Here we overwrite the default title
# sub title { 'Title form page 2' } ;
sub headline { 'Headline from page 2' } ;
!]
PAGE 2 [+ $_[0]->{test} +]
------------------------------->8------------------------------------
------------------------------->8----(head.epl)----------------------
<h2>
<font size=[+ $_[0] -> {fontsize} +]
color=[+ $_[0] -> {fontcolor} +]>
headline2
</font>
</h2>
------------------------------->8------------------------------------
--
Uni Siegen . Medienzentrum ** [EMAIL PROTECTED]
phone: +49(0)271/740 2282 ** fax: +49(0)271/740 2526
http://www.avmz.uni-siegen.de/ ** http://www.online-h.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]