How set dd(dump and die) in yii2 framework?

227 Views Asked by At

I want use DD (dump and die) like Laravel framework

How use it in yii2 framework?

1

There are 1 best solutions below

0
Ravi Thanki On

In yii2 create common component and add below code in component

if (function_exists('dd')) {
function dd(...$data)
{
    foreach ($data as $value) {
        echo '<pre>';
        print_r($value);
        echo '</pre>';
        echo '<br>';
    }
    exit;
}

}

you can call above function in any where just use component.