コード例 #1
0
ファイル: BasePresenter.php プロジェクト: shophp/shophp
 protected function startup()
 {
     parent::startup();
     if (!$this->currentCartService->getCurrentCart()->hasItems()) {
         $this->flashMessage('Yout cart is empty.');
         $this->redirect(':Front:Home:Homepage:');
     }
 }
コード例 #2
0
 public function __construct(UserService $userService, RegistrationFormFactory $registrationFormFactory, CurrentCartService $currentCartService, \Nette\Security\User $user)
 {
     parent::__construct();
     $this->userService = $userService;
     $this->registrationFormFactory = $registrationFormFactory;
     $this->currentCartService = $currentCartService;
     $this->user = $user;
 }
コード例 #3
0
ファイル: BasePresenter.php プロジェクト: shophp/shophp
 protected function startup()
 {
     parent::startup();
     if (!$this->user->isLoggedIn()) {
         $this->flashMessage('To enter the section please log in.');
         $this->redirect(':Front:Home:Homepage:');
     }
 }
コード例 #4
0
ファイル: ProductPresenter.php プロジェクト: shophp/shophp
 public function __construct(ProductService $productService, CategoryService $categoryService, CurrentCartService $currentCartService, BuyFormFactory $buyFormFactory, $imagesDir)
 {
     parent::__construct();
     $this->productService = $productService;
     $this->categoryService = $categoryService;
     $this->currentCartService = $currentCartService;
     $this->buyFormFactory = $buyFormFactory;
     $this->imagesDir = $imagesDir;
 }
コード例 #5
0
ファイル: OrderPresenter.php プロジェクト: shophp/shophp
 public function __construct(OrderService $orderService)
 {
     parent::__construct();
     $this->orderService = $orderService;
 }
コード例 #6
0
ファイル: CategoryPresenter.php プロジェクト: shophp/shophp
 public function __construct(CategoryService $categoryService, $imagesDir)
 {
     parent::__construct();
     $this->categoryService = $categoryService;
     $this->imagesDir = $imagesDir;
 }