當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。