function onInit() { parent::onInit(); $demos = FDRouterForm::getDemos(); $d = $this->getDocument(); $d->setVariable('prev', $prev = $this->getPrev()); if($prev) { $d->setVariable('prevTitle', $demos[$prev->getAction()]); } $d->setVariable('next', $next = $this->getNext()); if($next) { $d->setVariable('nextTitle', $demos[$next->getAction()]); } $d->setVariable('routerForm', new FDRouterForm($this->getRequest())); $d->setVariable('viewSource', new Location('FDViewSource', array('demo'=>get_class($this)))); $d->setVariable('viewTemplate', new Location('FDViewSource', array('demo'=>get_class($this), 'template'=>'1'))); }