Mini Controllers - modular page design

By Andy, filed under CakePHP, Tools, requestAction

The MVC pattern adds some clarity to what should go where when it comes to designing a page which requires some data from a data source. The model gets the data from the data source; the controller might do something with that data and then the view will display what the controller passes to it. If the page handles only a single function that's rather easy to both ...

read more11 comments

  • Elements and Recursion

    By Andy, filed under CakePHP, Tips, requestAction

    A long time ago, I took to using elements as shown in the paste below.

    echo $this->renderElement("Element",$params);
    
    1. echo $this->renderElement("Element",$params);
    2.  

    At the time, this was the only way I could find to pass the information from the view in general to the element. If this was needed at all, it was probably a temporary glitch but I kept to this syntax since that time. It is overkill to do this now, and...

    read more0 comments

«  »