A bare bones front-end for knockout designed for maximum compatibility with "obsolete" browsers
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

33 lignes
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. }