Moodle PHP Documentation 4.1
Moodle 4.1.11 (Build: 20240610) (c8c84b4af18)
core\output\mustache_filesystem_loader Class Reference

Perform some custom name mapping for template file names. More...

Inheritance diagram for core\output\mustache_filesystem_loader:
Mustache_Loader_FilesystemLoader Mustache_Loader

Public Member Functions

 __construct ()
 Provide a default no-args constructor (we don't really need anything).
 
 load ($name)
 Load a Template by name.
 

Protected Member Functions

 getFileName ($name)
 Helper function for getting a Mustache template file name.
 
 loadFile ($name)
 Helper function for loading a Mustache file by name.
 
 shouldCheckPath ()
 Only check if baseDir is a directory and requested templates are files if baseDir is using the filesystem stream wrapper.
 

Detailed Description

Perform some custom name mapping for template file names.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Since
2.9

Member Function Documentation

◆ getFileName()

core\output\mustache_filesystem_loader::getFileName ( $name)
protected

Helper function for getting a Mustache template file name.

Uses the leading component to restrict us specific directories.

Parameters
string$name
Return values
stringTemplate file name

Reimplemented from Mustache_Loader_FilesystemLoader.

◆ load()

Mustache_Loader_FilesystemLoader::load ( $name)
inherited

Load a Template by name.

$loader = new Mustache_Loader_FilesystemLoader(dirname(__FILE__).'/views');
$loader->load('admin/dashboard'); // loads "./views/admin/dashboard.mustache";
Parameters
string$name
Return values
stringMustache Template source

Implements Mustache_Loader.

◆ loadFile()

Mustache_Loader_FilesystemLoader::loadFile ( $name)
protectedinherited

Helper function for loading a Mustache file by name.

Exceptions
Mustache_Exception_UnknownTemplateExceptionIf a template file is not found
Parameters
string$name
Return values
stringMustache Template source

Reimplemented in Mustache_Loader_ProductionFilesystemLoader.

◆ shouldCheckPath()

core\output\mustache_filesystem_loader::shouldCheckPath ( )
protected

Only check if baseDir is a directory and requested templates are files if baseDir is using the filesystem stream wrapper.

Always check path for mustache_filesystem_loader.

Return values
boolWhether to check is_dir and file_exists

Reimplemented from Mustache_Loader_FilesystemLoader.


The documentation for this class was generated from the following file: