Skip to content

Instantly share code, notes, and snippets.

@AlexTiTanium
Created November 16, 2013 11:39
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 AlexTiTanium/7499248 to your computer and use it in GitHub Desktop.
Save AlexTiTanium/7499248 to your computer and use it in GitHub Desktop.
<?php
/**
* Contact information
*/
public function defaultEvent()
{
$this->view->setTemplate('editAccount');
$form = new Form($this->getFormConfig('contactInfo'));
$form->addBtn('Cохранить');
$form->set('icq', $this->user->getIcq());
$form->set('skype', $this->user->getSkype());
if (empty($_POST)) {
$this->view->set('form', $form->toString());
return;
}
$data = new Data($form->validate());
$this->user->setIcq($data->get('icq', ''));
$this->user->setSkype($data->get('skype', ''));
DoctrineOdm::save($this->user);
Session::addMessage('Выполненно', 'Даные изменены', Session::MESSAGE_TYPE_SUCCESS);
Manager::$Headers->redirect($this->url->toString(array('event' => false)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment