|
1234567891011121314151617181920212223242526272829303132 |
- <?php
-
- namespace App\BbCode\Tag;
-
- use Knockout\BbCode\Tag\TagInterface;
- use Knockout\BbCode\Tokenizer\Tag as TokenTag;
-
- class Quote implements TagInterface
- {
-
- public function format(TokenTag $tokenTag): string
- {
- $attrs = $tokenTag->parseArgument();
- return view('partial/bbcode/quote', [
- 'thread' => $attrs->threadId ?? 1,
- 'page' => $attrs->threadPage ?? 1,
- 'postId' => $attrs->postId ?? 1,
- 'username' => $attrs->username ?? 'Unknown',
- 'content' => $tokenTag->getText()
- ]);
- }
-
- public function getName(): string
- {
- return 'quote';
- }
-
- public function getOriginalText(TokenTag $tokenTag): string
- {
- return "[{$this->getName()}]{$tokenTag->getText()}[/{$this->getName()}";
- }
- }
|