Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Get HTML content inside controller
  • Dear sir,

    Is there any way to get html content inside the controller?

    This is because I would like to output pdf.

    So, I was thinking of making other action method and get the html content from the controller that output the data.

    Best regards,
  • HarroHarro
    Accepted Answer
    What do you mean with "get HTML content"?

    It is not the controller that generates the HTML, it is the rendering of the view (or the theme). And you can do that manually, both have a render() method.

    $view = View::forge('some/view');
    $html = $view->render();
  • Dear Harro,

    That is right.

    To get HTML, we should use view or theme's render() function.

    Thank you very much for your help.

    I just forgot about render() function because I do not manually use it often...

    Thanks a lot.

    What I means by "get HTML content" is getting whole html to be rendered on the web browser.

    Best regards,

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion