-1

Hey I use ominis/datatables bundle in Symfony 4.3. I store in my db country code from Intl. How to use Intl::getRegionBundle()->getCountryName($value) when i'm using table builider. My code below (but not working)

$table = $this->datatableFactory->create([])
        ->add('name', TextColumn::class, ['label' => 'Name', 'className' => 'bold'])
        ->add('adress', TextColumn::class, ['label' => 'Adress', 'className' => 'bold'])
        ->add('city', TextColumn::class, ['label' => 'City', 'className' => 'bold'])
        ->add('state', TextColumn::class, ['label' => 'State', 'className' => 'bold'])
        ->add('country_code', TextColumn::class, ['label' => 'Country', 'className' => 'bold', 'render' => function($value, $context) {
            return Intl::getRegionBundle()->getCountryName($value);}])
        ->add('vat', TextColumn::class, ['label' => 'VAT', 'className' => 'bold'])
        ->add('regon', TextColumn::class, ['label' => 'Regon', 'className' => 'bold'])
        ->createAdapter(ORMAdapter::class, [
            'entity' => Company::class
        ])
        ->handleRequest($request);

    if ($table->isCallback()) {
        return $table->getResponse();
    }     

1 Answers1

0

This work i made mistake with field name -,-