ProductGroupsController.php
3 years ago
ProductGroupsListTable.php
3 years ago
ProductGroupsScriptsController.php
3 years ago
ProductGroupsController.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCart\Controllers\Admin\ProductGroups; |
| 4 | |
| 5 | /** |
| 6 | * Handles product admin requests. |
| 7 | */ |
| 8 | class ProductGroupsController { |
| 9 | /** |
| 10 | * Index. |
| 11 | */ |
| 12 | public function index() { |
| 13 | $table = new ProductGroupsListTable(); |
| 14 | $table->prepare_items(); |
| 15 | return \SureCart::view( 'admin/product-groups/index' )->with( |
| 16 | [ |
| 17 | 'table' => $table, |
| 18 | ] |
| 19 | ); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Show |
| 24 | */ |
| 25 | public function show() { |
| 26 | // enqueue needed script. |
| 27 | add_action( 'admin_enqueue_scripts', \SureCart::closure()->method( ProductGroupsScriptsController::class, 'enqueue' ) ); |
| 28 | // return view. |
| 29 | return '<div id="app"></div>'; |
| 30 | } |
| 31 | } |
| 32 |