TextParser extends Helper
Wrapper for text parsers
Table of Contents
Properties
| $components | |
| $helpers | |
| $models |
Methods
| __construct() | |
| create() | Creates and returns an instance of the requested text parser |
| encode() | Encodes a string using the given parser |
| load() | Load the given file from the vendor directory |
Methods
__construct()
public
__construct() : mixed
create()
Creates and returns an instance of the requested text parser
public
create(string $parser) : mixed
Parameters
- $parser : string
-
The parser to use for encouding. Acceptable types are:
- markdown
Return values
mixed —Returns an instance of the parser object that was loaded, false if the parser was not found
encode()
Encodes a string using the given parser
public
encode(string $parser, string $text) : string
Parameters
- $parser : string
-
The parser to use for encouding. Acceptable types are:
- markdown
- $text : string
-
The text to encode using the given parser
Return values
string —The encoded text using the given parser
load()
Load the given file from the vendor directory
private
load(string $file) : mixed
Parameters
- $file : string
-
The file, including its relative path from the vendor directory, to load