Hi
I've started working with custom page classes. The basic example from Ryan's blog post works fine. Now: I'd like to set some object variables, which I can use in my methods. Usually this is done within the __constructor() method. My simplified example:
<?php namespace ProcessWire;
class ProgrammlistePage extends Page {
public $header = '';
public function __construct(){
$this->header = 'some text';
// parent::__construct();
}
public function header() {
return $this->header;
}
}
This results in an error in my nav function, related to Page.php (Trying to get property 'slashUrls' of non-object in /home/.../wire/core/Page.php on line 3245).
What am I doing wrong? I believe I should call the parent::__constructor(), but it didn't work either. I would appreciate a hint, where to look in the docs, because I feel I miss some basic understanding of the underlying mechanisms.
Thanks in advance!