SassList::append PHP Метод

append() публичный Метод

public append ( $other, $separator = null )
    public function append($other, $separator = null)
    {
        if ($separator) {
            $this->separator = $separator;
        }
        if ($other instanceof SassList) {
            $this->value = array_merge($this->value, $other->value);
        } elseif ($other instanceof SassLiteral) {
            $this->value[] = $other;
        } else {
            throw new SassListException('Appendation can only occur with literals', SassScriptParser::$context->node);
        }
    }

Usage Example

Пример #1
0
 public static function append($list, $val, $sep = ', ')
 {
     if ($list instanceof SassString) {
         $list = new SassList($list->toString());
     }
     $list->append($val, $sep);
     return $list;
 }