Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class CartPreviewComponent {
- public function __construct(CartModel $cartModel, $userId){
- $this->cartModel = $cartModel;
- $this->userId = $userId;
- }
- public function render(){
- return view('CartPreviewComponentTemplate', ['items' => $this->getItems()]);
- }
- public function getItems(){
- return $this->cartModel->getUserCart($this->userId);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement