products.php 547 B

1234567891011121314151617181920212223
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. namespace App;
  3. $core = Core::getInstance();
  4. $core->addBreadcrumb("/products", __("Products"));
  5. $nvp = [];
  6. $count = Product::count($nvp);
  7. $pagination = new Pagination($count);
  8. $pagination->setTerms(__("%s product"), __("%s products"));
  9. $products = Product::query($nvp, [
  10. "sort" => "id",
  11. "offset" => $pagination->getOffset(),
  12. "limit" => $pagination->getPageSize()
  13. ]);
  14. View::include("header");
  15. View::include("products", compact("products", "pagination"));
  16. View::include("footer");