protected $_pagetype = null;
+ protected $_subpage = null;
+
protected $_docspath = null;
protected $_legacyclass = null;
return $this->_pagetype;
}
+ /**
+ * @return string|null The subpage identifier, if any.
+ */
+ public function get_subpage() {
+ return $this->_subpage;
+ }
+
/**
* @return string the class names to put on the body element in the HTML.
*/
$this->_pagetype = $pagetype;
}
+ /**
+ * If context->id and pagetype are not enough to uniquely identify this page,
+ * then you can set a subpage id as well. For example, the tags page sets
+ * @param string $subpage an arbitrary identifier that, along with context->id
+ * and pagetype, uniquely identifies this page.
+ */
+ public function set_subpage($subpage) {
+ $this->_subpage = $subpage;
+ }
+
/**
* @param string $class add this class name ot the class attribute on the body tag.
*/
// Validate
$this->assertEqual('a-page-type', $this->testpage->pagetype);
}
+
+ public function test_set_subpage() {
+ // Exercise SUT
+ $this->testpage->set_subpage('somestring');
+ // Validate
+ $this->assertEqual('somestring', $this->testpage->subpage);
+ }
}
/**