A bare bones front-end for knockout designed for maximum compatibility with "obsolete" browsers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
557B

  1. <?php
  2. namespace App\BbCode\Tag;
  3. use Knockout\BbCode\Tag\TagInterface;
  4. use Knockout\BbCode\Tokenizer\Tag as TokenTag;
  5. class Youtube implements TagInterface
  6. {
  7. public function format(TokenTag $tokenTag): string
  8. {
  9. $url = $tokenTag->getText();
  10. return "<a href=\"{$url}\" target=\"_blank\">[Youtube Embed]</a>";
  11. }
  12. public function getName(): string
  13. {
  14. return 'youtube';
  15. }
  16. public function getOriginalText(TokenTag $tokenTag) : string
  17. {
  18. return "[youtube]{$tokenTag->getText()}[/youtube]";
  19. }
  20. }