src/Base/View.php
public function beforeRender($viewFile, $params)
    {
        $this->emit(self::EVENT_BEFORE_RENDER, [$this, $viewFile, $params]);
    }
public function beforeRender($viewFile, $params)
    {
        $this->emit(self::EVENT_BEFORE_RENDER, [$this, $viewFile, $params]);
    }
This method is invoked right before [[renderFile()]] renders a view file.
The default implementation will trigger the [[EVENT_BEFORE_RENDER]] event.
If you override this method, make sure you call the parent implementation first.
@param string $viewFile the view file to be rendered.
@param array $params the parameter array passed to the [[render()]] method.