当前位置: 首页>>代码示例>>PHP>>正文


PHP Form::getSaveButton方法代码示例

本文整理汇总了PHP中Venne\Forms\Form::getSaveButton方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getSaveButton方法的具体用法?PHP Form::getSaveButton怎么用?PHP Form::getSaveButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Venne\Forms\Form的用法示例。


在下文中一共展示了Form::getSaveButton方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handleSave

 public function handleSave(Form $form)
 {
     if ($form->isSubmitted() !== $form->getSaveButton()) {
         return;
     }
     $data = array('toolbar' => array());
     $i = TRUE;
     foreach ($form['toolbar']->values as $items) {
         if ($i) {
             $i = FALSE;
         } else {
             $data['toolbar'][] = '/';
         }
         $r = array();
         $i = TRUE;
         foreach ($items['line'] as $value) {
             if ($i) {
                 $i = FALSE;
             } else {
                 $data['toolbar'][] = array('items' => $r);
                 $r = array();
             }
             foreach ($value['items'] as $item) {
                 $r[] = $item;
             }
         }
         $data['toolbar'][] = array('items' => $r);
     }
     file_put_contents($this->ckeditorDir . '/backend.json', json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
 }
开发者ID:svobodni,项目名称:web,代码行数:30,代码来源:ToolbarFormFactory.php

示例2: formSuccess

 public function formSuccess(Form $form)
 {
     if ($form->isSubmitted() !== $form->getSaveButton()) {
         return;
     }
     $values = $form->values;
     $data = array('code' => 'K0ntrolaH3slem', 'jmeno' => $values['person'] == 'fyzicka' ? $values['fyzicka']['name'] : $values['pravnicka']['name'] . ' / ' . $values['pravnicka']['person'], 'narozeni' => $values['person'] == 'fyzicka' ? $values['fyzicka']['bornDate'] : $values['pravnicka']['IC'], 'ulice' => $values['street'], 'obec' => $values['city'], 'psc' => $values['psc'], 'email' => $values['email'], 'castka' => $values['money'] == 'other' ? $values['moneyOther'] : $values['money'], 'ip' => $this->httpRequest->remoteAddress);
     $params = '';
     foreach ($data as $key => $val) {
         $params .= '&' . $key . '=' . urlencode($val);
     }
     $params = ltrim($params, '&');
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, 'http://s-dary.zvara.cz/inject.php');
     curl_setopt($ch, CURLOPT_POST, count($data));
     curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     $result = curl_exec($ch);
     $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     curl_close($ch);
     if ($status == 200) {
         $this->flashMessage('Děkujeme, částku prosím uhraďte na náš transparentní účet s variabilním symbolem ' . $result, 'success');
     } elseif ($status == 403) {
         $this->flashMessage('Server nemá povolení k provedení akce. Prosím kontaktujte administrátora. ', 'warning');
     } else {
         $this->flashMessage('Nastala chyba při ukládání, zopakujte prosím akci později', 'warning');
     }
     $this->redirect('this');
 }
开发者ID:svobodni,项目名称:web,代码行数:29,代码来源:RoutePresenter.php

示例3: formSuccess

 public function formSuccess(Form $form)
 {
     if ($form->isSubmitted() === $form->getSaveButton()) {
         $x = $this->newsletterManager->sendNewsletter($form->data);
         $this->presenter->flashMessage('Newsletter byl odeslán na ' . $x . ' kontaktů.');
         $this->redirect('this');
     }
 }
开发者ID:venne,项目名称:newsletter-module,代码行数:8,代码来源:MessageControl.php

示例4: formSuccess

 public function formSuccess(Form $form)
 {
     if ($form->isSubmitted() !== $form->getSaveButton()) {
         return;
     }
     $this->getImporter()->run($form);
     $this->flashMessage($this->translator->translate('Process has been finished'), 'success');
     $this->redirect('this');
 }
开发者ID:svobodni,项目名称:web,代码行数:9,代码来源:ImporterPresenter.php

示例5: formSuccess

 public function formSuccess(Form $form)
 {
     if ($form->isSubmitted() !== $form->getSaveButton()) {
         return;
     }
     $this->flashMessage($this->translator->translate('Configuration has been saved.'), 'success');
     if (!$this->isAjax()) {
         $this->redirect('this');
     }
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:CkeditorPresenter.php

示例6: handleSave

 public function handleSave(Form $form)
 {
     if ($form->hasSaveButton() && $form->isSubmitted() === $form->getSaveButton()) {
         try {
             $this->mapper->entityManager->getRepository(get_class($form->data))->save($form->data);
         } catch (\Exception $e) {
             $ok = true;
             if (is_array($this->onCatchError) || $this->onCatchError instanceof \Traversable) {
                 foreach ($this->onCatchError as $handler) {
                     if (\Nette\Callback::create($handler)->invokeArgs(array($form, $e))) {
                         $ok = false;
                         break;
                     }
                 }
             } elseif ($this->onCatchError !== NULL) {
                 $class = get_class($this);
                 throw new \Nette\UnexpectedValueException("Property {$class}::onCatchError must be array or NULL, " . gettype($this->onCatchError) . " given.");
             }
             if ($ok) {
                 throw $e;
             }
         }
     }
 }
开发者ID:svobodni,项目名称:web,代码行数:24,代码来源:FormFactory.php

示例7: overloadFormSuccess

 public function overloadFormSuccess(Form $form)
 {
     if ($form->isSubmitted() === $form->getSaveButton() && !$form->errors) {
         $this->redirect('default');
     }
 }
开发者ID:svobodni,项目名称:web,代码行数:6,代码来源:TemplatesPresenter.php

示例8: actionFormSuccess

 public function actionFormSuccess(VForm $form)
 {
     $this->invalidateControl('actionForm');
     if ($form->hasSaveButton() && $form->isSubmitted() === $form->getSaveButton()) {
         $this->id = NULL;
         $this->formName = NULL;
         if (!$this->presenter->isAjax()) {
             $this->redirect('this', array('formName' => NULL, 'id' => NULL, 'mode' => NULL));
         }
         $this->invalidateControl('table');
         if ($this->mode === $this::MODE_PLACE) {
             $this->invalidateControl('navbarFormContainer');
             $this->invalidateControl('actionFormContainer');
         }
         $this->presenter->payload->url = $this->link('this', array('formName' => NULL, 'id' => NULL, 'mode' => NULL));
     }
 }
开发者ID:venne,项目名称:cms-module,代码行数:17,代码来源:AdminGrid.php

示例9: formSuccess

 public function formSuccess(Form $form)
 {
     $values = $form->getValues();
     $button = $form->isSubmitted();
     if ($values->remember) {
         $form->presenter->user->setExpiration('+ 14 days', FALSE);
     } else {
         $form->presenter->user->setExpiration('+ 20 minutes', TRUE);
     }
     if ($button === $form->getSaveButton()) {
         try {
             $form->presenter->user->login($values->username, $values->password);
         } catch (AuthenticationException $e) {
             $this->onError($this, $e->getMessage());
         }
     } else {
         $this->redirect('login!', str_replace('_', ' ', $button->name));
     }
     $this->onSuccess($this);
     $this->redirect('this');
 }
开发者ID:svobodni,项目名称:web,代码行数:21,代码来源:LoginControl.php

示例10: handleSuccess

 public function handleSuccess(Form $form)
 {
     if ($form->isSubmitted() === $form->getSaveButton()) {
         $values = $form->values;
         if ($values['type'] == 'component') {
             $file = $this->getFileByClass($values['component']);
             $baseName = $file->getBasename('.php') . '.latte';
             $template = $file->getPath() . '/' . $baseName;
             $target = $this->moduleHelpers->expandPath('@' . $values['target'] . 'Module', 'Resources/layouts');
             if ($values['layout']) {
                 $target .= '/' . $values['layout'];
             }
             $target .= '/' . $baseName;
         } else {
             $presenter = explode(':', $values['presenter']);
             $module = lcfirst($presenter[0]);
             $page = lcfirst($presenter[2]);
             $presenter = lcfirst($presenter[3]);
             $template = $this->moduleHelpers->expandPath('@' . $module . 'Module/@' . $page . '.' . $presenter . '.latte', 'Resources/layouts');
             $target = $this->moduleHelpers->expandPath('@' . $values['target'] . 'Module/' . ($values['layout'] ? $values['layout'] . '/' : '') . '@' . $page . '.' . $presenter . '.latte', 'Resources/layouts');
         }
         if (!copy($template, $target)) {
             $form->addError("Unable to copy file '{$template}' to '{$target}'.");
         }
     }
 }
开发者ID:svobodni,项目名称:web,代码行数:26,代码来源:OverloadFormFactory.php

示例11: formCreateSuccess

 public function formCreateSuccess(\Venne\Forms\Form $form)
 {
     if ($form->hasSaveButton() && $form->isSubmitted() === $form->getSaveButton()) {
         if (!$this->presenter->isAjax()) {
             $this->redirect('create!', array('createForm' => NULL));
         }
         $this->getPresenter()->invalidateControl('content');
         $this->presenter->payload->url = $this->link('create!', array('createForm' => NULL));
         $this->createForm = NULL;
         $this->handleCreate();
     } else {
         $this->invalidateControl('createForm');
     }
 }
开发者ID:svobodni,项目名称:web,代码行数:14,代码来源:TableControl.php


注:本文中的Venne\Forms\Form::getSaveButton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。