A bare bones front-end for knockout designed for maximum compatibility with "obsolete" browsers
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

Unknown.php 750B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\BbCode\Tag;
  3. use Knockout\BbCode\Tag\TagInterface;
  4. use Knockout\BbCode\Tokenizer\Tag as TokenTag;
  5. class Unknown implements TagInterface
  6. {
  7. public function format(TokenTag $tokenTag) : string
  8. {
  9. $formattedString = "[{$tokenTag->getType()}";
  10. if ($tokenTag->getArgument()) {
  11. $formattedString .= " {$tokenTag->getArgument()}";
  12. }
  13. $formattedString .= "]{$tokenTag->getText()}[/{$tokenTag->getType()}]";
  14. return $formattedString;
  15. }
  16. public function getName(): string
  17. {
  18. return '';
  19. }
  20. public function getOriginalText(TokenTag $tokenTag): string
  21. {
  22. return "[{$tokenTag->getType()}]{$tokenTag->getText()}[/{$tokenTag->getType()}]";
  23. }
  24. }