public static function Markdown::loadPath in Markdown 3.0.x
Same name and namespace in other branches
- 8.2 src/Markdown.php \Drupal\markdown\Markdown::loadPath()
Loads a cached ParsedMarkdown object.
Parameters
string $id: A unique identifier that will be used to cache the parsed markdown.
string $path: The local file system path of a markdown file to parse if the cached ParsedMarkdown object doesn't yet exist. Once parsed, its identifier will be set to the provided $id and then cached.
string $parser: Optional. The plugin identifier of the MarkdownParser to retrieve. If not provided, the first enabled Markdown filter in a text formatter available to the current user is used.
string|\Drupal\filter\Plugin\FilterInterface|\Drupal\filter\FilterFormatInterface $filter: Optional A specific filter plugin to use, a string representing a filter format or a FilterFormatInterface object containing a "markdown" filter.
\Drupal\Core\Session\AccountInterface $account: Optional. An account used to retrieve filters available filters if one wasn't already specified.
\Drupal\Core\Language\LanguageInterface $language: Optional. The language of the text that is being converted.
Return value
\Drupal\markdown\ParsedMarkdownInterface A ParsedMarkdown object.
Throws
\Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException When the provided $path does not exist in the local file system.
Overrides MarkdownInterface::loadPath
1 call to Markdown::loadPath()
- markdown_help in ./
markdown.module - Implements hook_help().
File
- src/
Markdown.php, line 60
Class
- Markdown
- Class Markdown.
Namespace
Drupal\markdownCode
public static function loadPath($id, $path, $parser = NULL, $filter = NULL, AccountInterface $account = NULL, LanguageInterface $language = NULL) {
return static::create()
->getParser($parser, $filter, $account)
->loadPath($id, $path, $language);
}