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

Breadcrumb

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

function ScaffoldFilePath::addInterpolationData

Adds data about the relative and full path to the provided interpolator.

Parameters

\Drupal\Composer\Plugin\Scaffold\Interpolator $interpolator: Interpolator to add data to.

string $name_prefix: (optional) Prefix to add before -rel-path and -full-path item names. Defaults to path type provided when constructing this object.

1 call to ScaffoldFilePath::addInterpolationData()
ScaffoldFilePath::getInterpolator in composer/Plugin/Scaffold/ScaffoldFilePath.php
Interpolate a string using the data from this scaffold file info.

File

composer/Plugin/Scaffold/ScaffoldFilePath.php, line 174

Class

ScaffoldFilePath
Manage the path to a file to scaffold.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

public function addInterpolationData(Interpolator $interpolator, $name_prefix = '') {
    if (empty($name_prefix)) {
        $name_prefix = $this->type;
    }
    $data = [
        'package-name' => $this->packageName(),
        "{$name_prefix}-rel-path" => $this->relativePath(),
        "{$name_prefix}-full-path" => $this->fullPath(),
    ];
    $interpolator->addData($data);
}
RSS feed
Powered by Drupal