You are here

function bootstrap_include in Express 8

Includes a file from a theme.

// Before.
bootstrap_include('my_subtheme', 'includes/file.inc');
bootstrap_include('my_subtheme', 'some/other/path/file.inc');

// After.
use Drupal\bootstrap\Bootstrap;
$my_subtheme = Bootstrap::getTheme('my_subtheme');
$my_subtheme
  ->includeOnce('file.inc');
$my_subtheme
  ->includeOnce('file.inc', 'some/other/path');

Parameters

string $theme: Name of the theme to use for base path.

string $path: Path relative to $theme.

Deprecated

Will be removed in a future release.

See also

\Drupal\bootstrap\Theme::includeOnce()

\Drupal\bootstrap\Bootstrap::getTheme()

File

themes/contrib/bootstrap/deprecated.php, line 823
This contains deprecated functions that will be removed in a future release.

Code

function bootstrap_include($theme, $path) {
  Bootstrap::deprecated();
  $theme = Bootstrap::getTheme($theme);
  $parts = explode('/', $path);
  $file = array_pop($parts);
  $dir = implode('/', $parts);
  $theme
    ->includeOnce($file, $dir);
}