PHP code example of fromholdio / silverstripe-superlinker
1. Go to this page and download the library: Download fromholdio/silverstripe-superlinker library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fromholdio / silverstripe-superlinker example snippets
use Fromholdio\SuperLinker\Model\SuperLink;
class Page extends SiteTree
{
private static $has_one = [
'CTALink' => SuperLink::class
];
}
use Fromholdio\HasOneEdit\HasOneMiniGridField;
public function getCMSFields(): FieldList
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main',
HasOneMiniGridField::create('CTALink', 'Call to Action', $this)
);
return $fields;
}
use Fromholdio\SuperLinkerTargets\Model\Target;
class Page extends SiteTree
{
private static $has_many = [
'RelatedLinks' => Target::class
];
}
public function getType(): ?string
public function getTypeLabel(?string $type = null): ?string
public function getTitle(): string
public function getDefaultTitle(): string
public function getURL(): ?string
public function getAbsoluteURL(): ?string
public function getHrefValue(): ?string
public function isLinkValid(): bool
public function isLinkOrphaned(): bool
public function isLinkEmpty(): bool
public static function excludeInvalidLinks(SS_List $links): ArrayList
public function getDefaultAttributes(): array
public function getTargetValue(): ?string
public function getRelValue(): ?string
public function getClassValue(): ?string
public function addExtraCSSClass(string $class): self
public function removeExtraCSSClass(string $class): self
public function isLinkTextEnabled(?string $type = null): bool
public function isOpenInNewEnabled(?string $type = null): bool
public function isOpenInNew(): bool
public function isNoFollowEnabled(?string $type = null): bool
public function isNoFollow(): bool
public function isNoOpener(): bool
public function isCurrent(): bool
public function isSection(): bool
public function LinkOrCurrent(): string
public function LinkOrSection(): string
public function LinkingMode(): string
public function forTemplate(): string
public function getCMSFields(): FieldList
public function getCMSLinkFields(string $fieldPrefix = ''): FieldList
public function getLinkedSiteTree(): ?SiteTree
public function getLinkedSiteTreeAnchor(): ?string
public function getAvailableSiteTreeAnchors(int|string|null $siteTreeID): array
public function getAllowedLinkedSiteTreeRoot(): ?SiteTree
// Uses ExternalURL field - no additional methods
// URL generated from Email, EmailCC, EmailBCC, EmailSubject, EmailBody fields
// Uses PhoneNumber field (DBPhone) - no additional methods
public function getLinkedFile(): ?File
public function isDownloadForced(): bool
public function getLinkedSystemLink(): ?ArrayData
public function getLinkedGlobalAnchor(): ?string
public function getDescription(): ?string
public function getDefaultDescription(): ?string
public function isLinkDescriptionEnabled(?string $type = null): bool
public function getIcon(): ?Image
public function getImage(): ?Image
public function getDefaultImage(): ?Image
public function isLinkImageEnabled(?string $type = null): bool