Grantlee
5.1.0
|
The InMemoryTemplateLoader loads Templates set dynamically in memory. More...
#include <grantlee/templateloader.h>
Public Member Functions | |
bool | canLoadTemplate (const QString &name) const override |
QPair< QString, QString > | getMediaUri (const QString &fileName) const override |
Template | loadByName (const QString &name, Engine const *engine) const override |
void | setTemplate (const QString &name, const QString &content) |
![]() | |
virtual | ~AbstractTemplateLoader () |
This class is mostly used for testing purposes, but can also be used for simple uses of Grantlee.
Templates can be made available using the setTemplate method, and will then be retrieved by the Grantlee::Engine as appropriate.
Definition at line 190 of file templateloader.h.
|
overridevirtual |
Return true if a Template identified by name
exists and can be loaded.
Implements Grantlee::AbstractTemplateLoader.
|
overridevirtual |
Return a complete URI for media identified by fileName.
Implements Grantlee::AbstractTemplateLoader.
|
overridevirtual |
Load a Template called name
. Return an invalid Template if no content by that name exists.
Implements Grantlee::AbstractTemplateLoader.
void Grantlee::InMemoryTemplateLoader::setTemplate | ( | const QString & | name, |
const QString & | content | ||
) |
Add a template content to this Loader.
Example: