本文整理匯總了PHP中theme_config::update_legacy_information方法的典型用法代碼示例。如果您正苦於以下問題:PHP theme_config::update_legacy_information方法的具體用法?PHP theme_config::update_legacy_information怎麽用?PHP theme_config::update_legacy_information使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類theme_config
的用法示例。
在下文中一共展示了theme_config::update_legacy_information方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: load
/**
* Load the config.php file for a particular theme, and return an instance
* of this class. (That is, this is a factory method.)
*
* @param string $themename the name of the theme.
* @return theme_config an instance of this class.
*/
public static function load($themename)
{
global $CFG;
// We have to use the variable name $THEME (upper case) because that
// is what is used in theme config.php files.
// Set some other standard properties of the theme.
$THEME = new theme_config();
$THEME->name = $themename;
$THEME->dir = $CFG->themedir . '/' . $themename;
// Load up the theme config
$configfile = $THEME->dir . '/config.php';
if (!is_readable($configfile)) {
throw new coding_exception('Cannot use theme ' . $themename . '. The file ' . $configfile . ' does not exist or is not readable.');
}
include $configfile;
$THEME->update_legacy_information();
return $THEME;
}