public function run()
{
if (YII_ENV == 'prod') {
try {
\Yii::beginProfile("Run: " . $this->_token);
$content = $this->_run();
\Yii::endProfile("Run: " . $this->_token);
} catch (\Exception $e) {
$content = \Yii::t('skeeks/cms', 'Error widget {class}', ['class' => $this->className()]) . " (" . $this->descriptor->name . "): " . $e->getMessage();
}
} else {
\Yii::beginProfile("Run: " . $this->_token);
$content = $this->_run();
\Yii::endProfile("Run: " . $this->_token);
}
if ($this->_isBegin) {
$result = $content;
} else {
$result = $this->_begin();
$result .= $content;
$result .= $this->_end();
}
return $result;
}