omines / datatables-bundle

DataTables bundle for Symfony
https://omines.github.io/datatables-bundle/
MIT License
258 stars 115 forks source link

Request $request #62

Closed jolio007 closed 5 years ago

jolio007 commented 5 years ago

I followed all the instruction of the quickstart guide yet, I'm getting an error with the Request request, it doesn't know what it is `

public function showAction(Request $request)
{
    $table = $this->createDataTable()
        ->add('firstName', TextColumn::class)
        ->add('lastName', TextColumn::class)
        ->createAdapter(ArrayAdapter::class, [
            ['firstName' => 'Donald', 'lastName' => 'Trump'],
            ['firstName' => 'Barack', 'lastName' => 'Obama'],
        ])
        ->handleRequest($request);

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

    return $this->render('list.html.twig', ['datatable' => $table]);
}

}`

MaximePinot commented 5 years ago

Hi,

Can you please provide the exact error message?

Also, make sure you imported the class:

use Symfony\Component\HttpFoundation\Request;
curry684 commented 5 years ago

As this issue cannot have anything to do with this bundle but must be a PHP level mistake elsewhere I'm closing this issue.

For generic assistance with programming please use Stack Overflow and leave Github issues for actual and reproducible issues, so us OSS developers can use our time efficiently.