本文整理匯總了PHP中Craft::getInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Craft::getInfo方法的具體用法?PHP Craft::getInfo怎麽用?PHP Craft::getInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Craft
的用法示例。
在下文中一共展示了Craft::getInfo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionSaveGeneralSettings
/**
* Saves the general settings.
*/
public function actionSaveGeneralSettings()
{
$this->requirePostRequest();
$info = Craft::getInfo();
$info->on = (bool) craft()->request->getPost('on');
$info->siteName = craft()->request->getPost('siteName');
$info->siteUrl = craft()->request->getPost('siteUrl');
$info->timezone = craft()->request->getPost('timezone');
if (Craft::saveInfo($info)) {
craft()->userSession->setNotice(Craft::t('General settings saved.'));
$this->redirectToPostedUrl();
} else {
craft()->userSession->setError(Craft::t('Couldn’t save general settings.'));
// Send the info back to the template
craft()->urlManager->setRouteVariables(array('info' => $info));
}
}
示例2: setNewCraftInfo
/**
* @param $version
* @param $build
* @param $releaseDate
* @return bool
*/
public function setNewCraftInfo($version, $build, $releaseDate)
{
$info = Craft::getInfo();
$info->version = $version;
$info->build = $build;
$info->releaseDate = $releaseDate;
// TODO: Deprecate after next breakpoint release.
$info->track = 'stable';
return Craft::saveInfo($info);
}