Issue #2563821 by dawehner: Implement Twig_Loader_String for ourselves
parent
570fba20cd
commit
5adf95a9bb
|
@ -25,7 +25,7 @@ namespace Drupal\Core\Template\Loader;
|
||||||
* @see \Drupal\Core\Render\Element\InlineTemplate
|
* @see \Drupal\Core\Render\Element\InlineTemplate
|
||||||
* @see twig_render_template()
|
* @see twig_render_template()
|
||||||
*/
|
*/
|
||||||
class StringLoader extends \Twig_Loader_String {
|
class StringLoader implements \Twig_LoaderInterface, \Twig_ExistsLoaderInterface {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
@ -39,4 +39,25 @@ class StringLoader extends \Twig_Loader_String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getSource($name) {
|
||||||
|
return $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getCacheKey($name) {
|
||||||
|
return $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function isFresh($name, $time) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue