HamlCompactRenderer.php 872 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /* SVN FILE: $Id: HamlCompactRenderer.php 74 2010-04-20 12:20:29Z chris.l.yates $ */
  3. /**
  4. * HamlCompactRenderer class file.
  5. * @author Chris Yates <chris.l.yates@gmail.com>
  6. * @copyright Copyright (c) 2010 PBM Web Development
  7. * @license http://phamlp.googlecode.com/files/license.txt
  8. * @package PHamlP
  9. * @subpackage Haml.renderers
  10. */
  11. /**
  12. * HamlCompactRenderer class.
  13. * Renders blocks on single lines.
  14. * @package PHamlP
  15. * @subpackage Haml.renderers
  16. */
  17. class HamlCompactRenderer extends HamlRenderer {
  18. /**
  19. * Renders the opening tag of an element
  20. */
  21. public function renderOpeningTag($node) {
  22. return ($node->isBlock ? '' : ' ') . parent::renderOpeningTag($node);
  23. }
  24. /**
  25. * Renders the closing tag of an element
  26. */
  27. public function renderClosingTag($node) {
  28. return parent::renderClosingTag($node) . ($node->isBlock ? "\n" : ' ');
  29. }
  30. }