开发者

yii debug rendering branch

开发者_StackOverflow

How can i see all view file names which was rendered for current page ?

in debug console there is no any info about which view files were loaded during page generation.


There is no native solution for this but it can be accomplished in a couple ways.

I think the easiest is to override the CViewRenderer class and keep a list of files that renderFile is called with. Overriding the class is a matter of adding

'viewRenderer'=>array
(
   'class'=>'MyViewRenderer',
),

In the components part in your config.

It could look like this in its simplest form:

class MyViewRenderer extends CViewRenderer
{
   public function renderFile($context, $sourceFile, $data, $return)
   {
      echo "Rendering " . $sourceFile . PHP_EOL;
      return parent::renderFile($context, $sourceFile, $data, $return)
   }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜