public function 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;
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Template!Loader!StringLoader.php/function/StringLoader::exists/8.1.x