Custom Detailview Widget not showing anything

Hi,

I have defined my custom Detailview Widget as follow:




    <?php

     $unitdesc = OptionUnit::findOne(1);

    

     DetailView::widget([

        'model' => $model,

        'attributes' => [

            'product',

            'price',

		[

			'attribute'=>'unit_id',

			'label' => 'Unit',

			'value' => $unitdesc->option_unit

		],

        ],

    ]) ?>



When running, it does nothing. Nothing is shown and no errors are given.

Any idea why?

Don’t worry, I changed it to code below and it works pefectly:




    <?php 

    	$unitdesc = OptionUnit::findOne(1);

    ?>


    <?=

     DetailView::widget([

        'model' => $model,

        'attributes' => [

            'product',

            'price',

		[

			'attribute'=>'unit_id',

			'label' => 'Unit',

			'value' => $unitdesc->option_unit,

		],

        ],

    ]) ?>




Blank pages are often the sign of a general php error. Have a look at your webserver log and in the yii2 runtime folder for any error.

Thanks, will remember in future.