Hi
i want to add 2 hooks onAfterPublish and onAfterUnpublish to my modules. basically i want to update my xml file based on page published and unpublished.
my config file include following code
Director::addRules(10, array(
SiteMapModule::$siteMapURLSegment => 'SiteMapModule',
));
and
class SiteMapModule extends Page_Controller {
public function onAfterPublish() {
$this->Content();
parent::onAfterPublish();
}
public function onAfterUnpublish() {
$this->Content();
parent::onAfterUnpublish();
}
public function Content() {
#code
#code
}
}
but this is not working? can anybody help me how to do this?