Source of file GlobalAnchors.php
Size: 0,875 Bytes - Last Modified: 2021-12-24T06:48:27+00:00
/var/www/docs.ssmods.com/process/src/src/GlobalAnchors.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445 | <?php namespace Fromholdio\GlobalAnchors; use SilverStripe\Core\Config\Configurable; use SilverStripe\Core\Extensible; use SilverStripe\Core\Injector\Injectable; class GlobalAnchors { use Extensible; use Injectable; use Configurable; private static $anchors = []; public static function add_to_class($class, $extensionClass, $args = null) { // NOP } public static function get_anchors() { $anchors = self::config()->get('anchors'); if (!$anchors || count($anchors) < 1) { return null; } return $anchors; } public static function get_anchor_title($key) { $anchors = self::get_anchors(); if (!$anchors) { return null; } if (!isset($anchors[$key])) { return null; } return $anchors[$key]; } } |