当前位置: 首页>>代码示例>>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;未经允许,请勿转载。