Link fragment - appends the current record ID to the URL.

@param string $action Optional action
@return string
541573
public function Link($action = null)
    {
        if ($this->currentRecord) {
            return Controller::join_links($this->parentController->Link(), "/{$this->currentRecord->ID}/{$action}");
        } else {
            return $this->parentController->Link();
        }

    }
297476
public function getOnAction($action)
    {
        $action = trim($action);

        if (empty($action)) {
            return null;
        }

        return Helpers::postFixWith($action, ';');
    }
692246
public function Link($action = null)
    {
        $page = Director::get_current_page();

        if ($page && !($page instanceof ElementController)) {
            return Controller::join_links(
                $page->Link($action),
                '#'. $this->element->getAnchor()
            );
        }

        $curr = Controller::curr();

        if ($curr && !($curr instanceof ElementController)) {
            return Controller::join_links(
                $curr->Link($action),
                '#'. $this->element->getAnchor()
            );
        }
    }
393272
public function Link($action = null)
    {
        if (!$this->form) {
            throw new LogicException(
                'Field must be associated with a form to call Link(). Please use $field->setForm($form);'
            );
        }

        $link = Controller::join_links($this->form->FormAction(), 'field/' . $this->name, $action);
        $this->extend('updateLink', $link, $action);
        return $link;
    }
186283
public function getViewer($action)
    {
        // Manually set templates should be dealt with by Controller::getViewer()
        if (isset($this->templates[$action]) && $this->templates[$action]
            || (isset($this->templates['index']) && $this->templates['index'])
            || $this->template
        ) {
            return parent::getViewer($action);
        }

        // Prepare action for template search
        if ($action == "index") {
            $action = "";
        } else {
            $action = '_' . $action;
        }

        $templates = array_merge(
            // Find templates by dataRecord
            SSViewer::get_templates_by_class(get_class($this->dataRecord), $action, "SilverStripe\\CMS\\Model\\SiteTree"),
            // Now get templates for sitetree
            SSViewer::get_templates_by_class(Page::singleton(), $action, "SilverStripe\\CMS\\Model\\SiteTree"),
            // Next, we need to add templates for all controllers
            SSViewer::get_templates_by_class(static::class, $action, "SilverStripe\\Control\\Controller"),
            // Fail-over to the same for the "index" action
            SSViewer::get_templates_by_class(get_class($this->dataRecord), "", "SilverStripe\\CMS\\Model\\SiteTree"),
            SSViewer::get_templates_by_class(static::class, "", "SilverStripe\\Control\\Controller")
        );

        return SSViewer::create($templates);
    }
807951
public function Link($action = null)
    {
        if ($this->shortcodableclass) {
            return Controller::join_links(
                $this->config()->url_base,
                $this->config()->sc_url_segment,
                'edit',
                $this->shortcodableclass
            );
        }
        return Controller::join_links($this->config()->url_base, $this->config()->sc_url_segment, $action);
    }
927979
public function Link($action = null)
    {
        $id = $this->element->ID;
        $segment = Controller::join_links('element', $id, $action);
        $page = Director::get_current_page();

        if ($page && !($page instanceof ElementController)) {
            return $page->Link($segment);
        }

        if ($controller = $this->getParentController()) {
            return $controller->Link($segment);
        }

        return $segment;
    }
336662
public function link($action = null)
    {
        if ($action) {
            return Controller::join_links($this->link, $action);
        }

        return $this->link;
    }
341858
function get_account_url( $action = false, $params = array(), $add_action_nonce = true ) {
            if ( is_string( $action ) ) {
                $params['fs_action'] = $action;
            }

            self::require_pluggable_essentials();

            return ( $add_action_nonce && is_string( $action ) ) ?
                fs_nonce_url( $this->_get_admin_page_url( 'account', $params ), $action ) :
                $this->_get_admin_page_url( 'account', $params );
        }
193407
public function bestUrl(string $action): string
    {
        if ($this->viaAjax($action) || $this->viaApi($action)) {
            return home_url('/'); // Both ride on index.
        } elseif ($this->Wp->is_admin && ($this->s::isOwnMenuPage() || $this->s::isOwnMenuPageTab())) {
            return $this->urlRemove($this->c::currentUrl());
        } elseif ($this->Wp->is_admin && $action === '§dismiss-notice') {
            return $this->urlRemove($this->c::currentUrl());
        } elseif ($this->Wp->is_admin) {
            return self_admin_url('/');
        }
        return home_url('/'); // Fallback (default).
    }
1242204
public function AbsoluteLink($action = null)
    {
        if ($this->owner->hasMethod('alternateAbsoluteLink')) {
            return $this->owner->alternateAbsoluteLink($action);
        } else {
            return Director::absoluteURL($this->owner->Link($action));
        }
    }
337712
public function Link($action = null) {
		$link = $this->data()->Link(($action ? $action : true));
		
		$params = array();
		
		$tags = $this->getRequest()->getVar('tags');
		if (strlen($tags)) {
			$params['tags'] = $tags;
		}

		$popup = $this->getRequest()->getVar('popup');
		if ($popup) {
			$params['popup'] = 1;
		}
		
		$tagstr = count($params) ? '?' . http_build_query($params) : '';
		return Controller::join_links($link, $tagstr);
	}
930149
public function getActionRoute($action = null)
    {
        if (null === $action) {
            $action = $this->getEvent()
                ->getRouteMatch()
                ->getParam('action');
        }

        return $this->getRouteName().'/'.$action;
    }
377396
protected function post_data($action)
  {
      $this->post['METHOD'] = $action;
      $this->post['VERSION'] = $this->version;
      $this->post['PWD'] = $this->options['password'];
      $this->post['USER'] = $this->options['login'];
      $this->post['SIGNATURE'] = $this->options['signature'];

      return $this->urlize($this->post);
  }
1160156
protected function formatAction($action)
    {
        if ($this->rootNamespace && ! (strpos($action, '\\') === 0)) {
            return $this->rootNamespace.'\\'.$action;
        } else {
            return trim($action, '\\');
        }
    }
1036586
public function Link($action = null) {

		$parent = $this->getParent();
		if(!$parent) {
			return null;
		}
		$date = ($parent->URLFormatting !== '-') ? $this->dbObject('Date')->Format($parent->URLFormatting ?: 'y/MM/dd/') : '';
		$join = array(
			$parent->Link(),
			"{$date}{$this->URLSegment}/"
		);
		if($action) {
			$join[] = "{$action}/";
		}
		$link = Controller::join_links($join);
		return $link;
	}
550236
public function Link($action = null)
    {
        if (!$action) {
            $action = $this->step;
        }

        return $this->dataRecord->RelativeLink($action);
    }