Open sdvpnin opened 1 year ago
Using entity how we can display format with multiple columns
We want the combine 2 columns value and display in entity. Example Value=>1 and display date_start - date_end. date_start and date_end is class columns.
->add('price_period_id', 'entity', [ 'attr' => ['class' => 'form-select'], 'label' => __('cruds.price.fields.price_period'), 'rules' => 'required', 'class' => 'App\Models\Priceperiod', 'property' => 'date_start', /*'query_builder' => function (Priceperiod $objPriceperiod) { return $objPriceperiod->date_start." - ".$objPriceperiod->date_end; }*/ ])
Don't use entity, but select, and create the options/choices with pluck + attribute getter.
entity
select
choices
pluck
Using entity how we can display format with multiple columns
We want the combine 2 columns value and display in entity. Example Value=>1 and display date_start - date_end. date_start and date_end is class columns.