Note that there are some explanatory texts on larger screens.

plurals
  1. POHMVC and dynamic widgets
    text
    copied!<h2>Background</h2> <p>I use the word widget as a partial view that have its own controller (so its own actions) and it is placed in almost all pages. I implement the rendering of this via HMVC, that is just great.</p> <h2>Problem</h2> <p>Now, the problem is that the widget itself execute actions. Think about a shopping cart widget. That widget is placed in all pages so the user can see his/her stuff all along. And the widget have actions that are related to it, for instance: RemoveItem, RefreshCart, ApplyDiscountCoupon, etc. Such actions should trigger by a button or link and the link should be something like (in HMVC):</p> <pre><code>&lt;a href='&lt;?site_url()?&gt;/cart/cart/removeitem/the_item_id'&gt;Remove this item&lt;/a&gt; </code></pre> <p>Ok. Now the user clicks that link, the cart module and cart controller are loaded and the action is executed, the action should look something like:</p> <pre><code>function removeitem($itemid) { // remove the item from db ... // "load the view" ??? } </code></pre> <p>As you can see, my question is how to load the view in a HMVC module. The thing is that if I only load the cart view, it will only show my cart, and I can’t just redirect or load the main page because it can be any main page, that is: the cart could be in any main page (select product, keep buying, see product details, billing info, checkout, etc). :/</p> <p>Another thing: a requirement is that I can’t use AJAX in this project.</p> <p>Do you know how HMVC handle this?</p> <p>Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload