Skip to content

Instantly share code, notes, and snippets.

@simensen
Created January 27, 2010 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simensen/288230 to your computer and use it in GitHub Desktop.
Save simensen/288230 to your computer and use it in GitHub Desktop.
<?php
// Called when the POST form is submitted.
protected function onSubmit(halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) {
$space = $this->spaceRepository->findById(
$httpRequest->getUrlParam('spaceId')
);
$space->setName($httpRequest->getPostParam('name'));
$space->setPhone($httpRequest->getPostParam('phone'));
$space->setAddressLine1($httpRequest->getPostParam('addressLine1'));
$space->setAddressLine2($httpRequest->getPostParam('addressLine2'));
$space->setCity($httpRequest->getPostParam('city'));
$space->setState($httpRequest->getPostParam('state'));
$space->setZipcode($httpRequest->getPostParam('zipcode'));
$this->spaceRepository->save($space);
return null;
}
// Called when rendering the form to get the details about the space.
public function referenceData(halo_HttpRequest $httpRequest, halo_HttpResponse $httpResponse) {
$model = array();
$model['space'] = $this->spaceRepository->findById($httpRequest->getUrlParam('spaceId'));
return $model;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment