Ok, so I am quite new to MVC, but I read a LOT about it the past weeks, and now started my first rather big project. Dependency injection, fat model, templates, one view per controller ... state of the art MVC as I would like to think.
Now there is one problem I can't get my head around. As I am building a webshop, I do for example have the shopping cart displayed on nearly every page. And of course the user can interact with that cart.
Now how can I avoid having an action in every controller that deals with this user interaction ?
I know this could be done by ajax, but let's assume I want to do it without. So what I mean:
/index/addtocart/25
/browse/addtocart/25
/cart/addtocart/25
/shoppinglist/addtocart/25
These should all do the same, have the same action on the cart model, but of course show different views. I hope I am clear about what I mean.
Maybe I am thinking of this the wrong way, so any help is appreciated. Thanks.