Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Template.php

function Template::setFile

Throws

InvalidArgumentException

1 call to Template::setFile()
Template::__construct in vendor/phpunit/php-text-template/src/Template.php

File

vendor/phpunit/php-text-template/src/Template.php, line 45

Class

Template

Namespace

SebastianBergmann\Template

Code

public function setFile(string $file) : void {
    if (is_file($file)) {
        $this->template = file_get_contents($file);
        return;
    }
    $distFile = $file . '.dist';
    if (is_file($distFile)) {
        $this->template = file_get_contents($distFile);
        return;
    }
    throw new InvalidArgumentException(sprintf('Failed to load template "%s"', $file));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal