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


PHP LeftAndMain::save方法代码示例

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


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

示例1: save

 public function save($data, $form)
 {
     $member = DataObject::get_by_id("Member", $data['ID']);
     if (!$member) {
         return $this->httpError(404);
     }
     $origLocale = $member->Locale;
     if (!$member->canEdit()) {
         $form->sessionMessage(_t('Member.CANTEDIT', 'You don\'t have permission to do that'), 'bad');
         return $this->redirectBack();
     }
     $response = parent::save($data, $form);
     if ($origLocale != $data['Locale']) {
         $response->addHeader('X-Reload', true);
         $response->addHeader('X-ControllerURL', $this->Link());
     }
     return $response;
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:18,代码来源:CMSProfileController.php

示例2: save

 public function save($urlParams, $form)
 {
     // Don't save the root folder - there's no database record
     if ($_REQUEST['ID'] == 'root') {
         FormResponse::status_message('Saved', 'good');
         return FormResponse::respond();
     }
     $form->dataFieldByName('Name')->Value = $form->dataFieldByName('Title')->Value();
     return parent::save($urlParams, $form);
 }
开发者ID:comperio,项目名称:silverstripe-cms,代码行数:10,代码来源:AssetAdmin.php

示例3: save

 /**
  * Save the content source/item.
  */
 public function save($urlParams, $form)
 {
     // Retrieve the record.
     $record = null;
     if (isset($urlParams['ID'])) {
         $record = ExternalContent::getDataObjectFor($urlParams['ID']);
     }
     if (!$record) {
         return parent::save($urlParams, $form);
     }
     if ($record->canEdit()) {
         // lets load the params that have been sent and set those that have an editable mapping
         if ($record->hasMethod('editableFieldMapping')) {
             $editable = $record->editableFieldMapping();
             $form->saveInto($record, array_keys($editable));
             $record->remoteWrite();
         } else {
             $form->saveInto($record);
             $record->write();
         }
         // Set the form response.
         $this->response->addHeader('X-Status', rawurlencode(_t('LeftAndMain.SAVEDUP', 'Saved.')));
     } else {
         $this->response->addHeader('X-Status', rawurlencode(_t('LeftAndMain.SAVEDUP', 'You don\'t have write access.')));
     }
     return $this->getResponseNegotiator()->respond($this->request);
 }
开发者ID:nyeholt,项目名称:silverstripe-external-content,代码行数:30,代码来源:ExternalContentAdmin.php


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