Get URL for back (reset) button

@return string
339813
public function getBackUrl()
    {
        if(!empty($this->_mail->getCustomerId())) {
            return $this->getUrl('customer/index/edit', array('id' => $this->_mail->getCustomerId()));
        }

        return $this->getUrl('index/index');
    }
337027
protected function getAutoSearchReset()
    {
        if ($menuItem = $this->menu->getCurrent()) {
            $link    = $menuItem->toActionLink($this->request, array('reset' => 1), $this->_('Reset search'));

            $element = new \MUtil_Form_Element_Html('reset');
            $element->setValue($link);

            return $element;
        }
    }
175853
public function url($reset = true)
    {
        $output = preg_replace('|^' . preg_quote(GRAV_ROOT, '|') . '|', '', $this->get('filepath'));

        $locator = Grav::instance()['locator'];
        if ($locator->isStream($output)) {
            $output = $locator->findResource($output, false);
        }

        if ($reset) {
            $this->reset();
        }

        return trim(Grav::instance()['base_url'] . '/' . $this->urlQuerystring($output), '\\');
    }
154655
public static function back_button($body = 'Go Back') {
        $html ='<a class="btn btn-default btn-xs" href="';
        $html .= URL::previous();
        $html .= '" ';
        $html .= 'role="button">';
        $html .= '<span class="fa fa-times"></span>';
        $html .= $body;
        $html .= '</a>';
        return $html;
    }
1166109
public function getBackURL()
    {
        $request = $this->getRequest();
        if (!$request) {
            return null;
        }
        $backURL = $request->requestVar('BackURL');
        // Fall back to X-Backurl header
        if (!$backURL && $request->isAjax() && $request->getHeader('X-Backurl')) {
            $backURL = $request->getHeader('X-Backurl');
        }
        if (!$backURL) {
            return null;
        }
        if (Director::is_site_url($backURL)) {
            return $backURL;
        }
        return null;
    }
680496
public function redirectBackToForm()
    {
        // Redirect back to form
        $url = $this->addBackURLParam(Security::singleton()->Link('changepassword'));

        return $this->redirect($url);
    }
954647
public function PrevLink()
    {
        if ($this->NotFirstPage()) {
            return HTTP::setGetVar(
                $this->getPaginationGetVar(),
                $this->getPageStart() - $this->getPageLength(),
                ($this->request instanceof HTTPRequest) ? $this->request->getURL(true) : null
            );
        }
    }
1256417
protected function renderGobackButton()
    {
        $options = [
            'class' => 'btn',
            'data-widget' => 'goback',
            'data-toggle' => 'tooltip',
            'title' => Yii::t('adminlte', 'Go back'),
        ];

        return Html::button(FA::i(FA::_ARROW_LEFT), $options);
    }
656000
public function getBackendDisplayMode(): string
    {
        $backendDisplayMode = $this->get('backendDisplayMode');
        $validModes = ['current', 'childs', 'both'];
        if (!\in_array($backendDisplayMode, $validModes, true)) {
            $backendDisplayMode = 'current';
        }

        return $backendDisplayMode;
    }
938667
public function getUrlBase() : string
    {
        $url = sprintf('%s://%s', $this->getScheme(), $this->host);
        $isStandardPort = ($this->port === ($this->isSecure ? 443 : 80));

        return $isStandardPort ? $url : $url . ':' . $this->port;
    }
482457
protected function getBackUrl(Request $request)
    {
        if (($backUrl = $request->input('_redirectBack')) == \URL::previous()) {
            $backUrl = null;
            $request->merge(['_redirectBack' => $backUrl]);
        }

        return $backUrl;
    }
930513
public function getDefaultUrl(): string
    {
        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('pages');
        $firstPageInTree = $connection->select(['uid'], 'pages', ['pid' => 0], [], ['sorting' => 'ASC'], 1)->fetchColumn(0);
        $url = BackendUtility::getViewDomain($firstPageInTree);

        return $url;
    }
1345561
public function BackLinkTracking()
    {
        // @todo - Implement PolymorphicManyManyList to replace this
        $list = ArrayList::create();

        $siteTreelinkTable = SiteTreeLink::singleton()->baseTable();

        // Get the list of back links classes
        $parentClasses = $this->BackLinks()->exclude(['ParentClass' => null])->columnUnique('ParentClass');

        // Get list of sitreTreelink and join them to the their parent class to make sure we don't get orphan records.
        foreach ($parentClasses as $parentClass) {
            $joinClause = sprintf(
                "\"%s\".\"ParentID\"=\"%s\".\"ID\"",
                $siteTreelinkTable,
                DataObject::singleton($parentClass)->baseTable()
            );

            $links = DataObject::get($parentClass)
                ->innerJoin(
                    $siteTreelinkTable,
                    $joinClause
                )
                ->where([
                    "\"$siteTreelinkTable\".\"LinkedID\"" => $this->ID,
                    "\"$siteTreelinkTable\".\"ParentClass\"" => $parentClass,
                ])
                ->alterDataQuery(function ($query) {
                    $query->selectField("'Content link'", "DependentLinkType");
                });
            $list->merge($links);
        }

        return $list;
    }
1291462
public function getCurrentUrlFolder() {
        $url = self::getCurrentUrl();
        $pieces = explode('/', $url);
        array_pop($pieces);
        $retval = implode('/', $pieces);
        return $retval;
    }
899228
public function back()
    {
        $this->getDriver()->curl($this->getDriver()->factoryCommand('back', WebDriver_Command::METHOD_POST));
        return $this;
    }
973470
protected function calculateReturnUrl()
    {
        $currentUri = $this->util->getCurrentURI();

        /*
        // Referrer would be powerful when someone is usng multiple windows, but
        // the loop does not always provide a correct referrer.
        $referrer   = $_SERVER["HTTP_REFERER"];

        // If a referrer was specified and that referral is from the current site, then use it
        // as it is more dependable when the user has multiple windows open on the application.
        if ($referrer && (0 == strncasecmp($referrer, $currentUri, strlen($currentUri)))) {
            return $referrer;
            // \MUtil_Echo::track($referrer);
        } // */

        // Use the survey return if available.
        $surveyReturn = $this->currentUser->getSurveyReturn();
        if ($surveyReturn) {
            // Do not show the base url as it is in $currentUri
            $surveyReturn['NoBase'] = true;

            // Add route reset to prevet the current parameters to be
            // added to the url.
            $surveyReturn['RouteReset'] = true;

            // \MUtil_Echo::track($currentUri, \MUtil_Html::urlString($surveyReturn));
            return $currentUri . \MUtil_Html::urlString($surveyReturn);
        }

        // Ultimate backup solution for return
        return $currentUri . '/ask/forward/' . \MUtil_Model::REQUEST_ID . '/' . urlencode($this->getTokenId());
    }
912142
protected function getPreviousButton()
    {
        if ($this->paginator->currentPage() <= 1) {
            return $this->getDisabledLink($this->previousButtonText);
        }

        $url = $this->paginator->url(
            $this->paginator->currentPage() - 1
        );

        return $this->getPrevNextPageLinkWrapper($url, $this->previousButtonText, 'prev');
    }