Lavary\Menu\Builder::mergeStatic PHP Method

mergeStatic() public static method

Merge item's attributes with a static string of attributes
public static mergeStatic ( $new = null, array $old = [] ) : string
$old array
return string
    public static function mergeStatic($new = null, array $old = array())
    {
        // Parses the string into an associative array
        parse_str(preg_replace('/\\s*([\\w-]+)\\s*=\\s*"([^"]+)"/', '$1=$2&', $new), $attrs);
        // Merge classes
        $attrs['class'] = self::formatGroupClass($attrs, $old);
        // Merging new and old array and parse it as a string
        return self::attributes(array_merge(array_except($old, array('class')), $attrs));
    }