#include <HtmlTemplateView.h>
Inheritance diagram for HtmlTemplateView:
Collaboration diagram for HtmlTemplateView:Public Member Functions | |
| HtmlTemplateView (const std::string &source, TemplateSource mode=TemplateSource::Inline) | |
| std::string | render (const std::map< std::string, std::string > &context={}) const override |
| Render the view body. | |
| void | render (HttpRequest &req, HttpResponse &res) |
| std::string | getContentType () const override |
| Return the MIME content type for this view. | |
Public Member Functions inherited from FrameworkView | |
| virtual | ~FrameworkView ()=default |
| virtual void | applyHeaders (HttpResponse &response) const |
| Optional hook to set response headers (e.g., Content-Disposition). | |
| virtual std::string | render (const nlohmann::json &context) const |
| Optional JSON context hook (used by JsonView or convenience). | |
Private Attributes | |
| std::string | templateSource_ |
| std::string | filePath_ |
| TemplateSource | mode_ |
Definition at line 25 of file HtmlTemplateView.h.
| HtmlTemplateView::HtmlTemplateView | ( | const std::string & | source, |
| TemplateSource | mode = TemplateSource::Inline |
||
| ) |
Definition at line 10 of file HtmlTemplateView.cpp.
References filePath_, Inline, mode_, and templateSource_.
|
overridevirtual |
Implements FrameworkView.
Definition at line 59 of file HtmlTemplateView.cpp.
|
overridevirtual |
Optional context (used by templates).
Implements FrameworkView.
Definition at line 23 of file HtmlTemplateView.cpp.
References filePath_, AppContext::getTypeKey(), Inline, mode_, and templateSource_.
Referenced by render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 31 of file HtmlTemplateView.h.
References render(), HttpResponse::send(), and HttpResponse::setContentType().
Here is the call graph for this function:
|
private |
Definition at line 40 of file HtmlTemplateView.h.
Referenced by HtmlTemplateView(), and render().
|
private |
Definition at line 41 of file HtmlTemplateView.h.
Referenced by HtmlTemplateView(), and render().
|
private |
Definition at line 39 of file HtmlTemplateView.h.
Referenced by HtmlTemplateView(), and render().