You are here

protected function MarkdownConfig::prefixKey in Markdown 8.2

Prefixes a key, if a prefix is set.

Parameters

string $key: The key to prefix.

Return value

string The prefixed key.

File

src/Config/MarkdownConfig.php, line 95

Class

MarkdownConfig
Markdown Config.

Namespace

Drupal\markdown\Config

Code

protected function prefixKey($key) {
  if ($prefix = $this
    ->getKeyPrefix()) {
    if (($pos = strpos($key, "{$prefix}.")) === 0) {
      $key = substr($key, strlen("{$prefix}."));
    }
    $key = "{$prefix}.{$key}";
  }
  return $key;
}