|
1234567891011121314151617181920212223242526 |
- <?php
-
- namespace App\BbCode\Tag;
-
- use Knockout\BbCode\Tag\TagInterface;
- use Knockout\BbCode\Tokenizer\Tag as TokenTag;
-
- class Video implements TagInterface
- {
-
- public function format(TokenTag $tokenTag): string
- {
- $url = $tokenTag->getText();
- return "<a href=\"{$url}\" target=\"_blank\">[Video Embed]</a>";
- }
-
- public function getName(): string
- {
- return 'video';
- }
-
- public function getOriginalText(TokenTag $tokenTag) : string
- {
- return "[video]{$tokenTag->getText()}[/video]";
- }
- }
|