Skip to content

Instantly share code, notes, and snippets.

@pascaldevink
Created October 18, 2009 20:31
Show Gist options
  • Save pascaldevink/212827 to your computer and use it in GitHub Desktop.
Save pascaldevink/212827 to your computer and use it in GitHub Desktop.
public function signupAction() {
$this->view->title = 'Signup';
$form = new SignupForm('/user/signup');
$this->view->formResponse = '';
if ($this->_request->isPost()) {
if ($form->isValid($_POST)) {
$signupdate = new Zend_Date();
$client = new Zend_Rest_Client('http://localhost:8080');
$data = array('surname'=>$this->_getParam('firstname'),
'infix'=>$this->_getParam('infix'),
'lastname'=>$this->_getParam('lastname'),
'email'=>$this->_getParam('email'),
'signupdate' => $signupdate->toString('yyyy-MM-dd hh:mm:ss'));
$response = $client->restPost('/yourapp/signups', $data);
} else {
$this->view->formResponse = 'Sorry';
}
}
$this->view->form = $form;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment