Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using entity how we can display format with multiple columns #713

Open
sdvpnin opened this issue Jun 23, 2023 · 1 comment
Open

Using entity how we can display format with multiple columns #713

sdvpnin opened this issue Jun 23, 2023 · 1 comment

Comments

@sdvpnin
Copy link

sdvpnin commented Jun 23, 2023

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;
            }*/
        ])
@rudiedirkx
Copy link
Collaborator

Don't use entity, but select, and create the options/choices with pluck + attribute getter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants