View more context



Is it possible to use logic in a page controller to choose between 2 different Layout templates? something like if $currentMember is in group A then use layout template A else use layout template B


tfft!! probably the first time I got a correct approach on the first try!!! 😉


You could use renderWith() to specify the template which is used to render the page.


You could probably have a separate function for the different pages, and use the template magic to render the right template automagically

  1. public function index() {
  2. if (...) {
  3. return $this->renderWith('template1');
  4. }
  5. else {
  6. return $this->renderWith('template2');
  7. }
  8. }