function Extension::load

Same name in other branches
  1. 9 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::load()
  2. 10 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::load()
  3. 11.x core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::load()

Loads the main extension file, if any.

Return value

bool TRUE if this extension has a main extension file, FALSE otherwise.

File

core/lib/Drupal/Core/Extension/Extension.php, line 145

Class

Extension
Defines an extension (file) object.

Namespace

Drupal\Core\Extension

Code

public function load() {
    if ($this->filename) {
        include_once $this->root . '/' . $this->getPath() . '/' . $this->filename;
        return TRUE;
    }
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.