libs/Yii/web/renderers/CViewRenderer.php

(开头部分) 3KB

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

<?php
/**
 * CViewRenderer class file.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @link http://www.yiiframework.com/
 * @copyright Copyright &copy; 2008-2011 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

/**
 * CViewRenderer is the base class for view renderer classes.
 *
 * A view renderer is an application component that renders views written
 * in a customized syntax.
 *
 * Once installing a view renderer as a 'viewRenderer' application component,
 * the normal view rendering process will be intercepted by the renderer.
 * The renderer will first parse the source view file and then render the
 * the resulting view file.
 *
 * Parsing results are saved as temporary files that may be stored
 * under the application runtime directory or together with the source view file.
 *
 * @author Steve Heyns http://customgothic.com/
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @version $Id$
 * @package system.web.renderers
 * @since 1.0
 */
abstract class CViewRenderer extends CApplicationComponent implements IViewRenderer
{
	/**
	 * @var boolean whether to store the parsing results in the application's
	 * runtime directory. Defaults to true. If false, the parsing results will
	 * be saved as files under the same directory as the source view files and the
	 * file names will be the source file names appended with letter 'c'.
	 */
	public $useRuntimePath=true;
	/**
	 * @var integer the chmod permission for temporary directories and files
	 * generated during parsing. Defaults to 0755 (owner rwx, group rx and others rx).
	 */
	public $filePermission=0755;
	/**
	 * @var string the extension name of the view file. Defaults to '.php'.
	 */
	public $fileExtension='.php';

	/**
	 * Parses the source view file and saves the results as another file.
	 * @param string $sourceFile the source view file path
	 * @param string $viewFile the resulting view file path
	 */
	abstract protected function generateViewFile($sourceFile,$viewFile);

	/**
	 * Renders a view file.
	 * This method is required by {@link IViewRenderer}.
	 * @param CBaseController $context the controller or widget who is rendering the view file.
后面还有 37 行代码,购买后查看完整代码

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

AI 解读

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

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