API / Minn\Blocks\Dynamic / SocialLinks

SocialLinks final class

Minn\Blocks\Dynamic\SocialLinks · public/minn/src/Minn/Blocks/Dynamic/SocialLinks.php · 79 lines

core/social-links and core/social-link. The list keeps its stored wrapper and gains the flex layout classes; each link renders from its parent's icon colours and the service's icon. The icons are the reference's rendered output captured as data (src/data/social-icons.json, the upstream set is CC0); an unknown service gets the share icon.

Constants and properties

privatePARENT_SETTINGS = array ( 'openInNewTab' => true, 'showLabels' => true, 'iconColor' => true, 'iconColorValue' => true, 'iconBackgroundColor' => true, 'iconBackgroundColorValue' => true, )

What a social-links list provides its links as context.

private?array $icons
privatereadonly string $iconsFile

Promoted from the constructor.

Public

new__construct(string $iconsFile)#
methodregister(Minn\Blocks\Renderer $renderer): void#

Registers the block and its links with the renderer.

Internals 3

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatelist(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string#
privatelink(Minn\Blocks\Block $link, Minn\Blocks\Block $parent): string#
privateicons(): array#
@return array<string, array{label: string, svg: string}>