If you call requestAction with 'return' specified, then you get the
rendered page, sans layout.  To get the layout you need to get the
request to have autoLayout = true, which you can do in your
beforeFilter.

In my application I wanted to be able to get this full HTML for any
action.  The first solution was to pass an additional parameter to the
requestAction, and check for this in the AppController beforeFilter,
so that autoLayout is set for any request like this:
$full_html = $this->requestAction( $target_action, array('return',
'fullLayout'=>'true') );

... in app_controller.php
function beforeFilter(){
  if ( @$this->params['cannonball_email'] == true ){
    $this->autoLayout = true;
  }
}

After doing it this way I thought it would be best if the
requestAction call could determine whether the layout was included, so
I submitted this ticket: https://trac.cakephp.org/ticket/2133
However, upon reflection the above method seems quite acceptable :)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to