Skip to content

Instantly share code, notes, and snippets.

@jsmitka
Created February 28, 2010 20:37
Show Gist options
  • Save jsmitka/317783 to your computer and use it in GitHub Desktop.
Save jsmitka/317783 to your computer and use it in GitHub Desktop.
<?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