class BadgeTwigExtension extends AbstractExtension (View source)

Constants

private RECORD_TYPE_CLASSES

private ZONE_TYPE_CLASSES

Methods

array
getFunctions()

No description

string
getRecordTypeClass(string|null $type)

No description

string
getZoneTypeClass(string $type)

No description

bool
isZoneReadOnly(string|null $type)

Secondary and Consumer zones replicate records from a primary, so their records are read-only - templates hide edit controls for them.

string
getZoneTypeLabel(string|null $type)

Translate a raw PowerDNS zone kind to the user-visible label, swapping Master/Slave for Primary/Secondary on PowerDNS 4.5+ where the upstream adopted the modern terminology. The internal kind value passed to the API never changes - this only affects what the UI shows.

string
getAutoprimariesLabel(string $key = 'plural')

PowerDNS 4.6 renamed "supermaster" to "autoprimary" in its config and pdnsutil; the API still uses /supermasters but UIs surface the new term.

resolveCapabilities()

Build a PdnsCapabilities snapshot from the session-cached PowerDNS version. Indirected so tests can override behaviour by subclassing.

Details

array getFunctions()

No description

Return Value

array

string getRecordTypeClass(string|null $type)

No description

Parameters

string|null $type

Return Value

string

string getZoneTypeClass(string $type)

No description

Parameters

string $type

Return Value

string

bool isZoneReadOnly(string|null $type)

Secondary and Consumer zones replicate records from a primary, so their records are read-only - templates hide edit controls for them.

Parameters

string|null $type

Return Value

bool

string getZoneTypeLabel(string|null $type)

Translate a raw PowerDNS zone kind to the user-visible label, swapping Master/Slave for Primary/Secondary on PowerDNS 4.5+ where the upstream adopted the modern terminology. The internal kind value passed to the API never changes - this only affects what the UI shows.

Parameters

string|null $type

Return Value

string

string getAutoprimariesLabel(string $key = 'plural')

PowerDNS 4.6 renamed "supermaster" to "autoprimary" in its config and pdnsutil; the API still uses /supermasters but UIs surface the new term.

Returns full strings (not composed at the template) so gettext can translate each variant as a single unit.

Parameters

string $key

Return Value

string

protected PdnsCapabilities resolveCapabilities()

Build a PdnsCapabilities snapshot from the session-cached PowerDNS version. Indirected so tests can override behaviour by subclassing.

Return Value

PdnsCapabilities