StringLoader::exists

public StringLoader::exists($name)

Check if we have the source code of a template, given its name.

Parameters

string $name The name of the template to check if we can load:

Return value

bool If the template source code is handled by this loader or not

Overrides Twig_ExistsLoaderInterface::exists

File

core/lib/Drupal/Core/Template/Loader/StringLoader.php, line 28

Class

StringLoader
Loads string templates, also known as inline templates.

Namespace

Drupal\Core\Template\Loader

Code

public function exists($name) {
  if (strpos($name, '{# inline_template_start #}') === 0) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}
doc_Drupal
2016-10-29 09:45:15
Comments
Leave a Comment

Please login to continue.