本文整理汇总了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');
}
}
示例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');
}
示例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:[]}'));
}
}