Assignment.php 717 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Assignment
  4. *
  5. * @package Less
  6. * @subpackage tree
  7. */
  8. class Less_Tree_Assignment extends Less_Tree {
  9. public $key;
  10. public $value;
  11. public $type = 'Assignment';
  12. public function __construct( $key, $val ) {
  13. $this->key = $key;
  14. $this->value = $val;
  15. }
  16. public function accept( $visitor ) {
  17. $this->value = $visitor->visitObj( $this->value );
  18. }
  19. public function compile( $env ) {
  20. return new Less_Tree_Assignment( $this->key, $this->value->compile( $env ) );
  21. }
  22. /**
  23. * @see Less_Tree::genCSS
  24. */
  25. public function genCSS( $output ) {
  26. $output->add( $this->key . '=' );
  27. $this->value->genCSS( $output );
  28. }
  29. public function toCss() {
  30. return $this->key . '=' . $this->value->toCSS();
  31. }
  32. }