SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2005
    Location
    Houston, TX
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CakePHP - Intercept view file contents before merge with layout

    I need to know of a way to intercept the output from my view file before it merges that content with the default layout. How can I get the view file contents so that I can manipulate them as I need to before allowing it to continue on?
    Tim Trice
    Tim Trice.com
    WP Eclipse.com
    Online Marketing and Website Development

  2. #2
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you mean you want to include a partial inside of another partial?
    Have a good day.

  3. #3
    SitePoint Zealot
    Join Date
    Jul 2005
    Location
    Houston, TX
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm writing a Helper that will take the contents of a controller's view file which is in XML format, catch that data before merging with the layout so that I can transform the XML with XSL into HTML. I have the basic processing setup between the controller, view and the XSL files. The last problem (I hope) I'm having is catching the controller's view to process before it goes inside the layout file.
    Tim Trice
    Tim Trice.com
    WP Eclipse.com
    Online Marketing and Website Development

  4. #4
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your best bet is to make a separate conroller for that view and assign no layout to it then set its data output type to XML. Then use the XSL to get it from that output URL. I think it is $this->layout = ''; to use no layout on the current controller. Otherwise you can try putting $this->layout = ''; in the current action and see if it doesn't assign the template to it. (has been a while since I used CakePHP)
    Have a good day.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •