Created
November 16, 2013 11:39
-
-
Save AlexTiTanium/7499248 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 | |
/** | |
* 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