yiiapi/framework/web/CThemeManager.php

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * CThemeManager class file.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @link http://www.yiiframework.com/
 * @copyright 2008-2013 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

/**
 * CThemeManager manages the themes for the Web application.
 *
 * A theme is a collection of view/layout files and resource files
 * (e.g. css, image, js files). When a theme is active, {@link CController}
 * will look for the specified view/layout under the theme folder first.
 * The corresponding view/layout files will be used if the theme provides them.
 * Otherwise, the default view/layout files will be used.
 *
 * By default, each theme is organized as a directory whose name is the theme name.
 * All themes are located under the "WebRootPath/themes" directory.
 *
 * To activate a theme, set the {@link CWebApplication::setTheme theme} property
 * to be the name of that theme.
 *
 * Since a self-contained theme often contains resource files that are made
 * Web accessible, please make sure the view/layout files are protected from Web access.
 *
 * @property array $themeNames List of available theme names.
 * @property string $basePath The base path for all themes. Defaults to "WebRootPath/themes".
 * @property string $baseUrl The base URL for all themes. Defaults to "/WebRoot/themes".
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @package system.web
 * @since 1.0
 */
class CThemeManager extends CApplicationComponent
{
	/**
	 * default themes base path
	 */
	const DEFAULT_BASEPATH='themes';

	/**
	 * @var string the name of the theme class for representing a theme.
	 * Defaults to {@link CTheme}. This can also be a class name in dot syntax.
	 */
	public $themeClass='CTheme';

	private $_basePath=null;
	private $_baseUrl=null;


	/**
	 * @param string $name name of the theme to be retrieved
	 * @return CTheme the theme retrieved. Null if the theme does not exist.
	 */
	public function getTheme($name)
	{
		$themePath=$this->getBasePath().DIRECTORY_SEPARATOR.$name;
后面还有 70 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。