src/Dca/DcaUtil.php
public function getEditLink(string $module, int $id, string $label = null): string
    {
        $url = $this->container->get('huh.utils.url')->getCurrentUrl([
            'skipParams' => true,
        ]);

        if (!$id) {
            return '';
        }

        $label = sprintf(StringUtil::specialchars($label ?: $GLOBALS['TL_LANG']['tl_content']['editalias'][1]), $id);

        return sprintf(
            ' <a href="'.$url.'?do=%s&amp;act=edit&amp;id=%s&amp;rt=%s" title="%s" style="padding-left: 5px; padding-top: 2px; display: inline-block;">%s</a>',
            $module,
            $id,
            $this->container->get('security.csrf.token_manager')->getToken($this->container->getParameter('contao.csrf_token_name'))->getValue(),
            $label,
            Image::getHtml('alias.svg', $label, 'style="vertical-align:top"')
        );
    }
public function getEditLink(string $module, int $id, string $label = null): string
    {
        $url = $this->container->get('huh.utils.url')->getCurrentUrl([
            'skipParams' => true,
        ]);

        if (!$id) {
            return '';
        }

        $label = sprintf(StringUtil::specialchars($label ?: $GLOBALS['TL_LANG']['tl_content']['editalias'][1]), $id);

        return sprintf(
            ' <a href="'.$url.'?do=%s&amp;act=edit&amp;id=%s&amp;rt=%s" title="%s" style="padding-left: 5px; padding-top: 2px; display: inline-block;">%s</a>',
            $module,
            $id,
            $this->container->get('security.csrf.token_manager')->getToken($this->container->getParameter('contao.csrf_token_name'))->getValue(),
            $label,
            Image::getHtml('alias.svg', $label, 'style="vertical-align:top"')
        );
    }
public function getEditLink ( string $ module , int $ id , string $ label = null ) : string { $ url = $ this -> container -> get ( 'huh.utils.url' ) -> getCurrentUrl ( [ 'skipParams' => true , ] ) ; if ( ! $ id ) { return '' ; } $ label = sprintf ( StringUtil :: specialchars ( $ label ? : $ GLOBALS [ 'TL_LANG' ] [ 'tl_content' ] [ 'editalias' ] [ 1 ] ) , $ id ) ; return sprintf ( ' <a href="' . $ url . '?do=%s&amp;act=edit&amp;id=%s&amp;rt=%s" title="%s" style="padding-left: 5px; padding-top: 2px; display: inline-block;">%s</a>' , $ module , $ id , $ this -> container -> get ( 'security.csrf.token_manager' ) -> getToken ( $ this -> container -> getParameter ( 'contao.csrf_token_name' ) ) -> getValue ( ) , $ label , Image :: getHtml ( 'alias.svg' , $ label , 'style="vertical-align:top"' ) ) ; }
Get a contao backend modal edit link.

@param string      $module Name of the module
@param int         $id     Id of the entity
@param string|null $label  The label text

@return string The edit link
Get a contao backend modal edit link .