Jobbuddy
Chargement...
Recherche...
Aucune correspondance
Référence de la classe ArrayLoader
Graphe d'héritage de ArrayLoader:
LoaderInterface

Fonctions membres publiques

 __construct (private array $templates=[],)
 setTemplate (string $name, string $template)
 getSourceContext (string $name)
 exists (string $name)
 getCacheKey (string $name)
 isFresh (string $name, int $time)

Description détaillée

Loads a template from an array.

When using this loader with a cache mechanism, you should know that a new cache key is generated each time a template content "changes" (the cache key being the source code of the template). If you don't want to see your cache grows out of control, you need to take care of clearing the old cache file by yourself.

This loader should only be used for unit testing.

Auteur
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( private array $templates = [])
Paramètres
array$templatesAn array of templates (keys are the names, and values are the source code)

Documentation des fonctions membres

◆ exists()

exists ( string $name)
Renvoie
bool

Implémente LoaderInterface.

◆ getCacheKey()

getCacheKey ( string $name)

Gets the cache key to use for the cache for a given template name.

Exceptions
LoaderErrorWhen $name is not found

Implémente LoaderInterface.

◆ getSourceContext()

getSourceContext ( string $name)

Returns the source context for a given template logical name.

Exceptions
LoaderErrorWhen $name is not found

Implémente LoaderInterface.

◆ isFresh()

isFresh ( string $name,
int $time )
Paramètres
int$timeTimestamp of the last modification time of the cached template
Exceptions
LoaderErrorWhen $name is not found

Implémente LoaderInterface.


La documentation de cette classe a été générée à partir du fichier suivant :