Created
September 13, 2017 08:32
-
-
Save MartinMuzatko/013ee9082f3f04161fc5c027794dbf93 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$events = new Events($this->wire); | |
$this->wire('events', $events, true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace ProcessWire; | |
class Events extends PagesType { | |
/** | |
* Construct the Events manager for the given parent and template | |
* | |
* @param Template|int|string|array $templates Template object or array of template objects, names or IDs | |
* @param int|Page|array $parents Parent ID or array of parent IDs (may also be Page or array of Page objects) | |
*/ | |
public function __construct(ProcessWire $wire, $templates = array(), $parents = array()) { | |
parent::__construct($wire, $templates, $parents); | |
// Make sure we always include the event template and /events/ parent page | |
$this->addTemplates("event"); | |
$this->addParents($this->pages->get("/events/")->id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment