function FrontMatter::getLine

Same name and namespace in other branches
  1. 8.9.x core/modules/help_topics/src/FrontMatter.php \Drupal\help_topics\FrontMatter::getLine()
  2. 10 core/lib/Drupal/Component/FrontMatter/FrontMatter.php \Drupal\Component\FrontMatter\FrontMatter::getLine()
  3. 11.x core/lib/Drupal/Component/FrontMatter/FrontMatter.php \Drupal\Component\FrontMatter\FrontMatter::getLine()

Retrieves the line where the source content starts, after any data.

Return value

int The source content line.

Throws

\Drupal\Component\FrontMatter\Exception\FrontMatterParseException

File

core/lib/Drupal/Component/FrontMatter/FrontMatter.php, line 196

Class

FrontMatter
Component for parsing front matter from a source.

Namespace

Drupal\Component\FrontMatter

Code

public function getLine() : int {
    return $this->parse()['line'];
}

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