Flush.php 597 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2011 Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. /**
  11. * Flushes the output to the client.
  12. *
  13. * @see flush()
  14. */
  15. class Twig_TokenParser_Flush extends Twig_TokenParser
  16. {
  17. public function parse(Twig_Token $token)
  18. {
  19. $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
  20. return new Twig_Node_Flush($token->getLine(), $this->getTag());
  21. }
  22. public function getTag()
  23. {
  24. return 'flush';
  25. }
  26. }