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


PHP Button::getForm方法代码示例

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


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

示例1: SaveProfile

 public function SaveProfile(Button $button)
 {
     $form = $button->getForm();
     $values = $form->getValues();
     try {
         if ($this->mode == 'superadmin') {
             if (isset($values['password_new'])) {
                 if ($values['password'] == $this->profile_data['password']) {
                     if ($values['password_new'] == $values['password_new_confirm']) {
                         $values['password'] = $values['password_new'];
                     } else {
                         throw new AuthenticationException('New password does not match.');
                     }
                 } else {
                     throw new AuthenticationException('Old password does not match with provided password.');
                 }
             } else {
                 unset($values['password']);
             }
             unset($values['password_new']);
             unset($values['password_new_confirm']);
             $this->config_data['admin'] = array_merge($this->config_data['admin'], $values);
             $config = new Config();
             $config->import($this->config_data);
             $config->save(APP_DIR . '/config/admin.ini', 'admin');
             $this->flash('Super admin profile updated');
         }
     } catch (Exception $e) {
         $this->flash($e->getMessage(), 'error');
     }
     $this->end();
 }
开发者ID:bazo,项目名称:Mokuji,代码行数:32,代码来源:AdminMyProfilePresenter.php

示例2: getForm

 public function getForm()
 {
     if ($this->form == null) {
         return parent::getForm();
     } else {
         return $this->form;
     }
 }
开发者ID:picon,项目名称:picon-framework,代码行数:8,代码来源:AjaxButton.php

示例3: formNewMenuItemSubmitted

 public function formNewMenuItemSubmitted(Button $button)
 {
     $form = $button->getForm();
     $values = $form->getValues();
     //fd($values);exit;
     $parent_data = explode(';', $values['parent_data']);
     if ($values['link_type'] == 'internal') {
         $values['url'] = $values['internal_url'];
     } else {
         if (substr($values['external_url'], 0, 6) == 'http://') {
             $values['url'] = $values['external_url'];
         } else {
             $values['url'] = 'http://' . $values['external_url'];
         }
     }
     unset($values['internal_url']);
     unset($values['external_url']);
     $parent_id = $parent_data[0];
     $parent_level = $parent_data[1];
     unset($values['parent_data']);
     unset($values['btnClose']);
     $values['parent'] = $parent_id;
     $values['level'] = $parent_level + 1;
     $values['menu_id'] = $this->menu->id;
     try {
         $this->model('menuItems')->create($values);
         $this->invalidateControl('menuDragDrop');
         $this->invalidateControl('frmNewItem');
         $this->validateControl('formNewMenuItem');
         $this->flash('Item ' . $values['title'] . ' created');
         //if(!$this->isAjax()) $this->redirect('this');
     } catch (DibiDriverException $e) {
         $this->flash($e->getMessage());
     }
     //$this->redirect('this');
 }
开发者ID:bazo,项目名称:Mokuji,代码行数:36,代码来源:AdminMenuItemsPresenter.php

示例4: FormSent

 public function FormSent(Button $btn)
 {
     $values = $btn->getForm()->getValues();
     $this->parent->flashMessage('Message Sent', 'success');
     $this->parent->redirect('this');
 }
开发者ID:bazo,项目名称:Mokuji,代码行数:6,代码来源:ContactForm.php

示例5: formEditSubmitted

 public function formEditSubmitted(Button $button)
 {
     $session = Environment::getSession('params')->remove();
     $form = $button->getForm();
     if ($form->isValid()) {
         $values = $form->getValues();
         unset($values['btnClose']);
         try {
             $this->model('pages')->update($values);
             $this->flash('Page updated');
             if (!$this->isAjax()) {
                 $this->redirect('Pages:');
             } else {
                 $this->invalidateControl('form');
                 $this->invalidateControl('grid');
             }
         } catch (DibiDriverException $e) {
             $this->flash($e->getMessage());
         }
     }
 }
开发者ID:bazo,项目名称:Mokuji,代码行数:21,代码来源:AdminPagesPresenter.php

示例6: formModuleInstallerSubmitted

 public function formModuleInstallerSubmitted(Button $button)
 {
     $form = $button->getForm();
     $values = $form->getValues();
     unset($values['btnClose']);
     $file = $values['file'];
     if ($file->isOK()) {
         $file->move(MODULES_DIR . '/' . $file->getName());
     }
 }
开发者ID:bazo,项目名称:Mokuji,代码行数:10,代码来源:AdminModulesPresenter.php

示例7: FormAddTermSubmitted

 public function FormAddTermSubmitted(Button $button)
 {
     $values = $button->getForm()->getValues();
     $start_datetime = $values['start_date'] . ' ' . $values['start_date_time'];
     unset($values['start_date']);
     unset($values['start_date_time']);
     $values['start_datetime'] = $start_datetime;
     $application_deadline = $values['deadline_date'] . ' ' . $values['deadline_date_time'];
     unset($values['deadline_date']);
     unset($values['deadline_date_time']);
     $values['application_deadline'] = $application_deadline;
     $teacher_id = $this->getUser()->getId();
     $values['teacher_id'] = (int) $teacher_id;
     $values['min_seminar_points'] = (int) $values['min_seminar_points'];
     try {
         $session = Environment::getSession('exam_terms_edit_form_' . $values['id']);
         if (isset($session['form_data'])) {
             ExamManager::update($values);
             $this->flashMessage('Term updated', 'success');
         } else {
             ExamManager::add($values);
             unset($session['form_data']);
             $this->flashMessage('Term added', 'success');
         }
         $this->template->show_popup = false;
         $this->invalidateControl('popup');
         $this->invalidateControl('flash');
         /*if(!$this->isAjax())*/
         $this->redirect('this');
     } catch (DibiException $e) {
         $this->flashMessage($e->getMessage(), 'error');
         $this->invalidateControl('popup_flash');
     }
 }
开发者ID:bazo,项目名称:diplomovka,代码行数:34,代码来源:ExamTermsPresenter.php

示例8: getSearchResults

 public function getSearchResults(Button $button)
 {
     $form = $button->getForm();
     $values = $form->getValues();
     $form->parent->flash('Search not implemented');
     $form->parent->end();
 }
开发者ID:bazo,项目名称:Mokuji,代码行数:7,代码来源:AdminBasePresenter.php


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