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


PHP Setting::saveFromData方法代码示例

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


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

示例1: _save

 /**
  * Saves the settings.
  */
 private final function _save()
 {
     $data = $_POST['setting'];
     // CSRF checks
     if (isset($_POST['csrf_token'])) {
         $csrf_token = $_POST['csrf_token'];
         if (!SecureToken::validateToken($csrf_token, BASE_URL . 'setting')) {
             Flash::set('error', __('Invalid CSRF token found!'));
             Observer::notify('csrf_token_invalid', AuthUser::getUserName());
             redirect(get_url('setting'));
         }
     } else {
         Flash::set('error', __('No CSRF token found!'));
         Observer::notify('csrf_token_not_found', AuthUser::getUserName());
         redirect(get_url('setting'));
     }
     if (!isset($data['allow_html_title'])) {
         $data['allow_html_title'] = 'off';
     }
     use_helper('Kses');
     $allowed = array('img' => array('src' => array()), 'abbr' => array('title' => array()), 'acronym' => array('title' => array()), 'b' => array(), 'blockquote' => array('cite' => array()), 'br' => array(), 'code' => array(), 'em' => array(), 'i' => array(), 'p' => array(), 'strike' => array(), 'strong' => array());
     $data['admin_title'] = kses(trim($data['admin_title']), $allowed);
     Setting::saveFromData($data);
     Flash::set('success', __('Settings have been saved!'));
     redirect(get_url('setting'));
 }
开发者ID:sindotnet,项目名称:cona,代码行数:29,代码来源:SettingController.php

示例2: _save

 private function _save()
 {
     $data = $_POST['setting'];
     if (!isset($data['allow_html_title'])) {
         $data['allow_html_title'] = 'off';
     }
     Setting::saveFromData($data);
     Flash::set('success', __('Settings has been saved!'));
     redirect(get_url('setting'));
 }
开发者ID:chaobj001,项目名称:tt,代码行数:10,代码来源:SettingController.php

示例3: _save

 function _save()
 {
     Setting::saveFromData($_POST['setting']);
     Flash::set('success', __('Settings has been saved!'));
     redirect(get_url('setting'));
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:6,代码来源:SettingController.php

示例4: _save

 /**
  * Saves the settings.
  */
 private final function _save()
 {
     $data = $_POST['setting'];
     // CSRF checks
     if (isset($_POST['csrf_token'])) {
         $csrf_token = $_POST['csrf_token'];
         if (!SecureToken::validateToken($csrf_token, BASE_URL . 'setting')) {
             Flash::set('error', __('Invalid CSRF token found!'));
             Observer::notify('csrf_token_invalid', AuthUser::getUserName());
             redirect(get_url('setting'));
         }
     } else {
         Flash::set('error', __('No CSRF token found!'));
         Observer::notify('csrf_token_not_found', AuthUser::getUserName());
         redirect(get_url('setting'));
     }
     if (!isset($data['allow_html_title'])) {
         $data['allow_html_title'] = 'off';
     }
     Setting::saveFromData($data);
     Flash::set('success', __('Settings have been saved!'));
     redirect(get_url('setting'));
 }
开发者ID:julpi,项目名称:FreshCMS,代码行数:26,代码来源:SettingController.php

示例5: save

 /**
  * Save activated plugins to the setting 'plugins'
  */
 static function save()
 {
     Setting::saveFromData(array('plugins' => serialize(self::$plugins)));
 }
开发者ID:julpi,项目名称:FreshCMS,代码行数:7,代码来源:Plugin.php


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