src/View/Helper/GuardianHelper.php
public function protectedLink($title, $url, $options = [], $displayLinkTextIfUnauthorized = false)
    {
        $url = $this->_getUrl($url);
        if (!guardian()->hasAccess($url)) {
            if ($displayLinkTextIfUnauthorized) {
                return $title;
            }
            return '';
        }
        return $this->link($title, $url, $options);
    }
public function protectedLink($title, $url, $options = [], $displayLinkTextIfUnauthorized = false)
    {
        $url = $this->_getUrl($url);
        if (!guardian()->hasAccess($url)) {
            if ($displayLinkTextIfUnauthorized) {
                return $title;
            }
            return '';
        }
        return $this->link($title, $url, $options);
    }
public function protectedLink ( $ title , $ url , $ options = [ ] , $ displayLinkTextIfUnauthorized = false ) { $ url = $ this -> _getUrl ( $ url ) ; if ( ! guardian ( ) -> hasAccess ( $ url ) ) { if ( $ displayLinkTextIfUnauthorized ) { return $ title ; } return '' ; } return $ this -> link ( $ title , $ url , $ options ) ; }
Create a properly prefixed backend link.

automatically prepends the backend url prefix to the desired $url

@param string $title The link title.
@param array|string $url The url to link to.
@param array $options Options passed to the html link helper method.
@param bool $displayLinkTextIfUnauthorized Whether to display the link title if the user is
not authorized to access the link.
@return string
Create a properly prefixed backend link .