app/Customize/Controller/Block/NewItemController.php line 22

Open in your IDE?
  1. <?php 
  2. namespace Customize\Controller\Block;
  3. use Eccube\Controller\AbstractController;
  4. use Eccube\Repository\ProductRepository;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  7. use Symfony\Component\HttpFoundation\Request;
  8. class NewItemController extends AbstractController{
  9.     protected $productRepository;
  10.     public function __construct(ProductRepository $productRepository){
  11.         $this->productRepository $productRepository;
  12.     }
  13.     /**
  14.      * Undocumented function
  15.      * @Route("/block/new_item", name="block_new_item", methods={"GET"})
  16.      * @Template("Block/new_item.twig")
  17.      */
  18.     public function index(Request $request){
  19.         $data $this->productRepository->findBy([],['id' => "DESC"],4);
  20.         return $this->render("Block/new_item.twig",[
  21.             'data' => $data
  22.         ]);
  23.     }
  24. }