Quentinb
(Quentin)
1
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?
Quentinb
(Quentin)
2
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,
],
],
]) ?>
melicerte
(Recycling Spam)
3
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.
Quentinb
(Quentin)
4
Thanks, will remember in future.