http://php.net/ob_start
http://php.net/ob_get_contents
$layout = $this->layout;
ob_start();
$this->layout = null;
$this->render('view');
$html = ob_get_contents();
ob_end_clean();
$this->layout = $layout;
On Jun 28, 12:14 pm, codecowboy <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have been wondering it is possible to have a function like render
> return as a string the html that is produced by a view after cake has
> processed it into html.
>
> For instance. Lets say that I am using a datagrid to return search
> results. I use a callback function to modify the content of certain
> cells. I want that callback function to use a .thtml to stylize the
> content of the cell. Basically, I am trying to follow MVC design
> pretty strictly. I do not want to create html in the call back
> function itself.
>
> Perhaps something like this is what I am looking for
>
> function printLink(...){
> .
> .
> .
>
> //set some vars for some_view.thtml
> .
> .
> .
>
> // Process the view and retrieve the html that resulted
> $strHtml = $this->render(some_view.thtml);
>
> return $strHtml;
>
> }
>
> I want the html that is returned by printLink(...) to be displayed in
> the datagrid cell. So my question is "Is there anything like that
> $this->render(some_view.thtml) that I can call in Cake?".
>
> Let me know if my question is unclear.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---