22 lines
551 B
PHP
22 lines
551 B
PHP
<?php
|
|
|
|
namespace Krzysiej\RyobiCrawler\Controller;
|
|
|
|
use Krzysiej\RyobiCrawler\Models\Product;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
use Symfony\Component\Routing\Attribute\Route;
|
|
|
|
final class IndexController extends BaseController
|
|
{
|
|
#[Route('/', name: 'app_home')]
|
|
public function __invoke(): Response
|
|
{
|
|
$products = Product::orderByDesc('starred')
|
|
->orderByDesc('created_by')
|
|
->get();
|
|
|
|
|
|
return $this->render('productList.html.twig', ['products' => $products, 'listType' => 'all']);
|
|
}
|
|
}
|