當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SiteConfig::save方法代碼示例

本文整理匯總了PHP中SiteConfig::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP SiteConfig::save方法的具體用法?PHP SiteConfig::save怎麽用?PHP SiteConfig::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SiteConfig的用法示例。


在下文中一共展示了SiteConfig::save方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: update

	public function update($title, $subtitle, $siteAuthor, $siteContactEmail,
	                       $friendlyURL, $UUID, $sitePath, $defaultLanguage,
	                       $databaseConnection, $databaseUser, $databasePassword)
	{
		$config = new SiteConfig;
		$config->title = $title;
		$config->subtitle = $subtitle;
		$config->siteAuthor = $siteAuthor;
		$config->siteContactEmail = $siteContactEmail;
		$config->friendlyURL = $friendlyURL;
		$config->UUID = $UUID;
		$config->sitePath = $sitePath;
		$config->databaseConnection = $databaseConnection;
		$config->databaseUser = $databaseUser;
		$config->defaultLanguage = $defaultLanguage;
		
		try
		{
			$config->save();
			
			$this->notice(t('Saved site configuration'));
			$this->redirect('admin/system');
		}
		catch (ValidationException $e)
		{
			$this->config = $config;
			$this->languages = $this->getLanguages();
			$this->error(t('Failed saving configuration'));
			$this->render('config');
		}
	}
開發者ID:nathansamson,項目名稱:CoOrg,代碼行數:31,代碼來源:admin.system.controller.php

示例2: getAdminInterface

 /**
  * Build and return admin interface
  * 
  * Any module providing an admin interface is required to have this function, which
  * returns a string containing the (x)html of it's admin interface.
  * @return string
  */
 function getAdminInterface()
 {
     $id = @$_REQUEST['siteconfig_id'];
     $option = new SiteConfig($id);
     switch (@$_REQUEST['action']) {
         case 'addedit':
             $form = $option->getAddEditForm();
             if ($form->validate() && $form->isSubmitted() && isset($_REQUEST['siteconfig_submit'])) {
                 // do nothing
             } else {
                 return $form->display();
             }
             break;
         case 'toggle':
             $option->setEditable(1 - $option->getEditable());
             $option->save();
             break;
         case 'delete':
             $option->delete();
             $option = NULL;
             break;
         default:
     }
     $siteconfigs = SiteConfig::getAllSiteConfigs();
     $norex = NOREX;
     $this->smarty->assign('norex', $norex);
     $this->smarty->assign('siteconfigs', $siteconfigs);
     return $this->smarty->fetch('admin/siteconfigs.tpl');
 }
開發者ID:anas,項目名稱:feedstore,代碼行數:36,代碼來源:SiteConfig.php

示例3: quizConfig

 public function quizConfig()
 {
     $quizConfigSchema = new \Schemas\QuizConfigSchema();
     $quizConfigDataRow = SiteConfig::where('name', 'quiz')->first();
     if (!$quizConfigDataRow) {
         $quizConfigDataRow = new SiteConfig();
         $quizConfigDataRow->name = 'quiz';
     }
     if (Request::ajax() && Request::isMethod('post')) {
         $quizConfigData = Input::get('quizConfig', array());
         $quizConfigDataRow->value = json_encode($quizConfigData);
         $quizConfigDataRow->save();
         return Response::json(array('success' => 1, 'quizConfig' => $quizConfigData));
     } else {
         return View::make('admin/config/quiz')->with(array('quizConfigSchema' => $quizConfigSchema->getSchema(), 'quizConfigData' => $quizConfigDataRow->value ? $quizConfigDataRow->value : '{quizConfig:[]}'));
     }
 }
開發者ID:thunderclap560,項目名稱:quizkpop,代碼行數:17,代碼來源:AdminConfigController.php


注:本文中的SiteConfig::save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。