TestLoader.php in Zircon Profile 8.0
File
core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php
View source
<?php
namespace Drupal\twig_loader_test\Loader;
use Drupal\Core\Template\Loader;
class TestLoader implements \Twig_LoaderInterface, \Twig_ExistsLoaderInterface {
public function getSource($name) {
if ($name == 'kittens') {
return $name;
}
else {
return 'cats';
}
}
public function exists($name) {
return TRUE;
}
public function getCacheKey($name) {
return $name;
}
public function isFresh($name, $time) {
return TRUE;
}
}