You are here

public function FrontMatter::getCode in Drupal 8

Retrieves the extracted source code.

Return value

string The extracted source code.

Throws

\Drupal\Component\Serialization\Exception\InvalidDataTypeException Exception thrown when the Front Matter cannot be parsed.

File

core/modules/help_topics/src/FrontMatter.php, line 143

Class

FrontMatter
Extracts Front Matter from the beginning of a source.

Namespace

Drupal\help_topics

Code

public function getCode() {
  return $this
    ->parse()['code'];
}