Class yii\twig\Profile

Inheritanceyii\twig\Profile » Twig_Extension_Profiler
Source Code https://github.com/yiisoft/yii2-twig/blob/master/src/Profile.php

Protected Properties

Hide inherited properties

Property Type Description Defined By

Public Methods

Hide inherited methods

Method Description Defined By
__construct() yii\twig\Profile

Property Details

Hide inherited properties

$profiler protected property
protected $profiler null
$view protected property
protected $view null

Method Details

Hide inherited methods

__construct() public method

public void __construct ( \Twig_Profiler_Profile $profile )
$profile

                public function __construct(Twig_Profiler_Profile $profile)
{
    $profile = new \Twig_Profiler_Profile();
    $dumper = new \Twig_Profiler_Dumper_Text();
    parent::__construct($profile);
    $view = \Yii::$app->getView();
    $view->on(View::EVENT_AFTER_RENDER, function () use ($profile, $dumper) {
        \Yii::trace($dumper->dump($profile));
    });
}