A bare bones front-end for knockout designed for maximum compatibility with "obsolete" browsers
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

33 Zeilen
806B

  1. <?php
  2. namespace App\BbCode\Tag;
  3. use Knockout\BbCode\Tag\TagInterface;
  4. use Knockout\BbCode\Tokenizer\Tag as TokenTag;
  5. class Quote implements TagInterface
  6. {
  7. public function format(TokenTag $tokenTag): string
  8. {
  9. $attrs = $tokenTag->parseArgument();
  10. return view('partial/bbcode/quote', [
  11. 'thread' => $attrs->threadId ?? 1,
  12. 'page' => $attrs->threadPage ?? 1,
  13. 'postId' => $attrs->postId ?? 1,
  14. 'username' => $attrs->username ?? 'Unknown',
  15. 'content' => $tokenTag->getText()
  16. ]);
  17. }
  18. public function getName(): string
  19. {
  20. return 'quote';
  21. }
  22. public function getOriginalText(TokenTag $tokenTag): string
  23. {
  24. return "[{$this->getName()}]{$tokenTag->getText()}[/{$this->getName()}";
  25. }
  26. }