yii debug rendering branch
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)
}
}
精彩评论