Twig/MenuExtension.php
public function arrayToAttr(array $array = [], array $append = [], array $options = [])
    {
        $array = array_merge_recursive($array, $append);
        $attr = '';

        foreach ($array as $key => $value) {
            if (\is_array($value)) {
                $value = implode(' ', $value);
            }

            if ('title' === mb_strtolower($key)) {
                if (!isset($array['title_translate'])) {
                    $value = $this->translator->trans($value, [], $options['trans_domain'] ?? null);
                }
            }

            $attr .= sprintf('%s="%s"', $key, $value);
        }

        return $attr;
    }
public function arrayToAttr(array $array = [], array $append = [], array $options = [])
    {
        $array = array_merge_recursive($array, $append);
        $attr = '';

        foreach ($array as $key => $value) {
            if (\is_array($value)) {
                $value = implode(' ', $value);
            }

            if ('title' === mb_strtolower($key)) {
                if (!isset($array['title_translate'])) {
                    $value = $this->translator->trans($value, [], $options['trans_domain'] ?? null);
                }
            }

            $attr .= sprintf('%s="%s"', $key, $value);
        }

        return $attr;
    }
public function arrayToAttr ( array $ array = [ ] , array $ append = [ ] , array $ options = [ ] ) { $ array = array_merge_recursive ( $ array , $ append ) ; $ attr = '' ; foreach ( $ array as $ key => $ value ) { if ( \ is_array ( $ value ) ) { $ value = implode ( ' ' , $ value ) ; } if ( 'title' === mb_strtolower ( $ key ) ) { if ( ! isset ( $ array [ 'title_translate' ] ) ) { $ value = $ this -> translator -> trans ( $ value , [ ] , $ options [ 'trans_domain' ] ?? null ) ; } } $ attr .= sprintf ( '%s="%s"' , $ key , $ value ) ; } return $ attr ; }
Array to Html Attr Convert.

@param array $array
@param array $append

@return string
Array to Html Attr Convert .