public function ymllink($str)
    {
        return preg_replace_callback(
            '/ ([a-z0-9_-]+\.yml)/i',
            function ($matches) {
                $path = $this->urlGenerator->generate('fileedit', ['namespace' => 'config', 'file' => $matches[1]]);
                $link = sprintf(' <a href="%s">%s</a>', $path, $matches[1]);

                return $link;
            },
            $str
        );
    }
public function ymllink($str)
    {
        return preg_replace_callback(
            '/ ([a-z0-9_-]+\.yml)/i',
            function ($matches) {
                $path = $this->urlGenerator->generate('fileedit', ['namespace' => 'config', 'file' => $matches[1]]);
                $link = sprintf(' <a href="%s">%s</a>', $path, $matches[1]);

                return $link;
            },
            $str
        );
    }
public function ymllink ( $ str ) { return preg_replace_callback ( '/ ([a-z0-9_-]+\.yml)/i' , function ( $ matches ) { $ path = $ this -> urlGenerator -> generate ( 'fileedit' , [ 'namespace' => 'config' , 'file' => $ matches [ 1 ] ] ) ; $ link = sprintf ( ' <a href="%s">%s</a>' , $ path , $ matches [ 1 ] ) ; return $ link ; } , $ str ) ; }
Create a link to edit a .yml file, if a filename is detected in the string. Mostly
for use in Flashbag messages, to allow easy editing.

@param string $str

@return string Resulting string
Create a link to edit a . yml file if a filename is detected in the string . Mostly for use in Flashbag messages to allow easy editing .