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


PHP FOFInput::getData方法代码示例

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


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

示例1: applySave

 /**
  * Common method to handle apply and save tasks
  *
  * @return  boolean  Returns true on success
  */
 protected final function applySave()
 {
     // Load the model
     $model = $this->getThisModel();
     if (!$model->getId()) {
         $model->setIDsFromRequest();
     }
     $id = $model->getId();
     $data = $this->input->getData();
     if (!$this->onBeforeApplySave($data)) {
         return false;
     }
     // Set the layout to form, if it's not set in the URL
     if (is_null($this->layout)) {
         $this->layout = 'form';
     }
     // Do I have a form?
     $model->setState('form_name', 'form.' . $this->layout);
     $status = $model->save($data);
     if ($status && $id != 0) {
         JResponse::setHeader('Status', '201 Created', true);
         // Try to check-in the record if it's not a new one
         $status = $model->checkin();
         if ($status) {
             $status = $this->onAfterApplySave();
         }
     }
     $this->input->set('id', $model->getId());
     if (!$status) {
         // Redirect on error
         $id = $model->getId();
         if ($customURL = $this->input->get('returnurl', '', 'string')) {
             $customURL = base64_decode($customURL);
         }
         if (!empty($customURL)) {
             $url = $customURL;
         } elseif ($id != 0) {
             $url = 'index.php?option=' . $this->component . '&view=' . $this->view . '&task=edit&id=' . $id . $this->getItemidURLSuffix();
         } else {
             $url = 'index.php?option=' . $this->component . '&view=' . $this->view . '&task=add' . $this->getItemidURLSuffix();
         }
         $this->setRedirect($url, '<li>' . implode('</li><li>', $model->getErrors()) . '</li>', 'error');
         return false;
     } else {
         $session = JFactory::getSession();
         $session->set($model->getHash() . 'savedata', null);
         return true;
     }
 }
开发者ID:alvarovladimir,项目名称:messermeister_ab_rackservers,代码行数:54,代码来源:controller.php

示例2: applySave

 /**
  * Common method to handle apply and save tasks
  *
  * @return  boolean  Returns true on success
  */
 protected final function applySave()
 {
     // Load the model
     $model = $this->getThisModel();
     if (!$model->getId()) {
         $model->setIDsFromRequest();
     }
     $id = $model->getId();
     $data = $this->input->getData();
     $this->onBeforeApplySave($data);
     $status = $model->save($data);
     if ($status && $id != 0) {
         JResponse::setHeader('Status', '201 Created', true);
         // Try to check-in the record if it's not a new one
         $status = $model->checkin();
         if ($status) {
             $status = $this->onAfterApplySave();
         }
     }
     $this->input->set('id', $model->getId());
     if (!$status) {
         // Redirect on error
         $id = $model->getId();
         if ($customURL = $this->input->get('returnurl', '', 'string')) {
             $customURL = base64_decode($customURL);
         }
         $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . $this->view . '&task=edit&id=' . $id;
         $this->setRedirect($url, '<li>' . implode('</li><li>', $model->getErrors()), 'error') . '</li>';
         return false;
     } else {
         $session = JFactory::getSession();
         $session->set($model->getHash() . 'savedata', null);
         return true;
     }
 }
开发者ID:brojask,项目名称:colegio-abogados-joomla,代码行数:40,代码来源:controller.php


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