Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Get HTML content inside controller
soseki
June 2016
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,
Harro
June 2016
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();
soseki
June 2016
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,
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
June 2016
soseki
June 2016