本文整理汇总了PHP中Nette\Application\UI\Form::getPresenter方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getPresenter方法的具体用法?PHP Form::getPresenter怎么用?PHP Form::getPresenter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Application\UI\Form
的用法示例。
在下文中一共展示了Form::getPresenter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: changeCategoryRankFormSucceeded
public function changeCategoryRankFormSucceeded(Form $form)
{
$values = (object) $form->getHttpData();
$this->categoryFacade->changeRanks($values->categoryRank);
$form->getPresenter()->flashMessage("Pořadí kategorií bylo úspěšně změněno.", "alert-success");
$form->getPresenter()->redirect("this");
}
示例2: uspesne
public function uspesne(Form $form, $hodnoty)
{
$zaznam = $this->database->table('druhZivocicha')->get($this->Id);
$zaznam->update($hodnoty);
$form->getPresenter()->flashMessage('Úspešne editované!', 'uspech');
$form->getPresenter()->redirect('Druh:viac', $this->Id);
}
示例3: uspesne
public function uspesne(Form $form, $hodnoty)
{
foreach ($hodnoty['umiestnenie'] as &$hodnota) {
if ($hodnota === '') {
$hodnota = NULL;
}
}
$zaznam = $this->database->table('umiestnenie')->insert($hodnoty['umiestnenie']);
if ($this->mod == 0) {
foreach ($hodnoty['klietka'] as &$hodnota) {
if ($hodnota === '') {
$hodnota = NULL;
}
}
$hodnoty['klietka']->IDUmiestnenia = $zaznam->IDUmiestnenia;
$this->database->table('klietka')->insert($hodnoty['klietka']);
} else {
foreach ($hodnoty['vybeh'] as &$hodnota) {
if ($hodnota === '') {
$hodnota = NULL;
}
}
$hodnoty['vybeh']->IDUmiestnenia = $zaznam->IDUmiestnenia;
$this->database->table('vybeh')->insert($hodnoty['vybeh']);
}
$form->getPresenter()->flashMessage('Úspešne pridané!', 'uspech');
$form->getPresenter()->redirect('Umiestnenie:vypis');
}
示例4: formSucceeded
/**
* Zpracovani formulare s anketou
* @param Form $form
* @param Nette\Utils\ArrayHash $values
*/
public function formSucceeded(Form $form, $values)
{
$result = TRUE;
if ($result) {
$form->getPresenter()->flashMessage($form->getTranslator()->translate('system.requestS'), 'success');
} else {
$form->getPresenter()->flashMessage($form->getTranslator()->translate('system.requestN'), 'danger');
}
}
示例5: formSucceeded
/**
* Zpracovani formulare s rubrikou
* @param Form $form
* @param Nette\Utils\ArrayHash $values
*/
public function formSucceeded(Form $form, $values)
{
//nova rubrika nebo jeji editace
$result = empty($values->id) ? $this->newTag($values) : $this->editTag($values);
if ($result) {
$form->getPresenter()->flashMessage($form->getTranslator()->translate('system.requestS'));
} else {
$form->getPresenter()->flashMessage($form->getTranslator()->translate('system.requestN'));
}
}
示例6: changeSystemSettingsFormSucceeded
public function changeSystemSettingsFormSucceeded(Form $form, $values)
{
$systemSettings = new SystemSettingsCollection();
foreach ($values as $name => $value) {
$systemSettings->addItem(SystemSettingsService::loadForUpdate($name, $value));
}
$this->systemSettingsFacade->save($systemSettings);
$form->getPresenter()->flashMessage("Systémové údaje byly úspěšně uloženy.", "alert-success");
$form->getPresenter()->redirect("this");
}
示例7: solutionFormSucceeded
/**
* @param Form $form
* @param $values
*/
function solutionFormSucceeded(Form $form, $values)
{
if ($values->file->isOk()) {
$values->projects_id = $this->projectManager->accepted($this->user->id)->id;
$values->file = FileUploadHandler::upload($values->file);
$this->database->table('solutions')->insert($values);
$form->getPresenter()->flashMessage('Solution has been successfully uploaded.', 'success');
} else {
$form->getPresenter()->flashMessage('Something went wrong while uploading a file :( .', 'danger');
}
}
示例8: monthFilterFormSucceeded
public function monthFilterFormSucceeded(Form $form, $values)
{
$form->getPresenter()->month = $values->month;
$form->getPresenter()->year = $values->year;
if ($values->offsetExists("user") && $values->user > 0) {
$form->getPresenter()->userId = $values->user;
} else {
$form->getPresenter()->userId = null;
}
$form->getPresenter()->redirect("this");
}
示例9: uspesne
public function uspesne(Form $form, $hodnoty)
{
$uzivatel = $form->getPresenter()->getUser();
try {
$uzivatel->login($hodnoty->RodneCislo, $hodnoty->heslo);
$uzivatel->setExpiration('1 hour', FALSE);
$form->getPresenter()->redirect('Umiestnenie:vypis');
} catch (Nette\Security\AuthenticationException $chyba) {
$form->getPresenter()->redirect('Homepage:prihlasenieNeuspech');
}
}
示例10: formSucceeded
public function formSucceeded(Form $form, $values)
{
try {
$userManager = new Model\UserManager($this->user, $this->database);
$userManager->register($values->username, $values->password, $values->repassword);
} catch (Nette\Security\AuthenticationException $e) {
$form->addError($e->getMessage());
}
if ($form->getPresenter()->isAjax()) {
$form->getPresenter()->redrawControl('register');
}
}
示例11: uspesne
public function uspesne(Form $form, $hodnoty)
{
foreach ($hodnoty as &$hodnota) {
if ($hodnota === '') {
$hodnota = NULL;
}
}
//kvoli db chcem tam mat null a nie prazdny string
$this->database->table('zivocich')->insert($hodnoty);
$form->getPresenter()->flashMessage('Úspešne pridané!', 'uspech');
$form->getPresenter()->redirect('Zivocich:vypis');
}
示例12: passwordChangeFormSucceeded
public function passwordChangeFormSucceeded(Form $form, $values)
{
$user = $this->userFacade->findOneById($this->user->getId());
if (!Passwords::verify($values->actualPassword, $user->hash)) {
$form->addError("Zadal si špatné aktuální heslo. Zkus to znovu!");
} else {
$user->changePassword($values->password);
$this->userFacade->save($user);
$form->getPresenter()->flashMessage("Tvoje heslo bylo úspěšně změněno", "alert-success");
$form->getPresenter()->redirect("this");
}
}
示例13: uspesne
public function uspesne(Form $form, $hodnoty)
{
foreach ($hodnoty as &$hodnota) {
if ($hodnota === '') {
$hodnota = NULL;
}
}
//kvoli db lebo tam chcem null a nie prazdnyretazec
$zaznam = $this->database->table('zivocich')->get($this->Id);
$zaznam->update($hodnoty);
$form->getPresenter()->flashMessage('Úspešne editované!', 'uspech');
$form->getPresenter()->redirect('Zivocich:viac', $this->Id);
}
示例14: uspesne
public function uspesne(Form $form, $hodnoty)
{
foreach ($hodnoty as &$hodnota) {
if ($hodnota === '') {
$hodnota = NULL;
}
}
//menim prazdne stringy na nully kvoli db
$hodnoty['heslo'] = md5($hodnoty['heslo']);
$this->database->table('zamestnanec')->insert($hodnoty);
$form->getPresenter()->flashMessage('Úspešne pridané!', 'uspech');
$form->getPresenter()->redirect('Zamestnanec:vypis');
}
示例15: uspesne
public function uspesne(Form $form, $hodnoty)
{
foreach ($hodnoty as &$hodnota) {
if ($hodnota === '') {
$hodnota = NULL;
}
}
// zmenim prazdne stringy na nully, kvoli db
$zaznam = $this->database->table('zamestnanec')->get($this->RodneCislo);
$zaznam->update($hodnoty);
$form->getPresenter()->flashMessage('Úspešne editované!', 'uspech');
$form->getPresenter()->redirect('Zamestnanec:viac', $this->RodneCislo);
}