Created
February 28, 2010 20:37
-
-
Save jsmitka/317783 to your computer and use it in GitHub Desktop.
This file contains 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 | |
final class HomePresenter extends BasePresenter{ | |
protected function startup(){ | |
parent::startup(); | |
$this->template->test = 'TestStartup'; | |
} | |
public function createComponentForm(){ | |
$form = new AppForm(); | |
$form->addText('test','Test:'); | |
$form->addSubmit('ok','OK')->onClick[] = array($this,'OkClicked'); | |
$form->addSubmit('cancel','Konec')->onClick[] = array($this,'CancelClicked'); | |
return $form; | |
} | |
public function OkClicked(Submitbutton $submit){ | |
$this->redirect('this', array('click' => 'Clicked')); | |
} | |
public function CancelClicked(Submitbutton $submit){ | |
$this->redirect('Neco:'); | |
} | |
public function renderDefault(){ | |
$this->template->form = $this['form']; | |
$this->template->clicked = $this->getParam('click'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment