Jump to content

How to create Grid or Table Data in Templates module.


Recommended Posts

In prestashop 1.7.5 I have an admin controler which extends FrameworkBundleAdminController.

Now I want to download data from my table in this controller and display it in the grid (table) in a similar way as customer data or their addresses are displayed. How do you do it in a twig based template?

Unless you can do it differently using a helper.

 

Share this post


Link to post
Share on other sites

You can retrieve DataBase information via

$query = 'SELECT * FROM myTable';
$rowsList = Db::getInstance()->executeS($query);

You can use a helper to display your form, in the same way you would do in a module.

$helper = new HelperForm();
...
$fields_form = ...
...
return $helper->generateForm($fieldsForm);

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More