Debug Toolbar in renderPartial

Is it possible to use the debug toolbar in a view generated by renderPartial?

Thanks!

David

Generally it needs a layout.

Thanks Alexander.

For those interested, I created a blank layout for debug purposes and used $this->render() instead of $this->renderPartial() while debugging.

/views/layouts/blank.php

<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
    <head>
        <?php $this->head() ?>
    </head>
    <body>
        <?php $this->beginBody() ?>
        <?= $content ?>
        <?php $this->endBody() ?>
    </body>
</html>
<?php $this->endPage() ?>

/controllers/SiteController.php

public function actionIndex()
{
    $this->layout = '@app/views/layouts/blank';        
    return $this->render('_freestock-agreements');
}

/controllers/SiteController.php (after debugging)

public function actionIndex()
{
    return $this->renderPartial('_freestock-agreements');
}

David

1 Like