Jump to content

Search the Community

Showing results for tags 'custom page class'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. 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!
×
×
  • Create New...