Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4064982
CitizenComponentLink.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
CitizenComponentLink.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Skins\Citizen\Components
;
use
MediaWiki\Html\Html
;
use
MediaWiki\Linker\Linker
;
use
MessageLocalizer
;
/**
* CitizenComponentLink component
*/
class
CitizenComponentLink
implements
CitizenComponent
{
public
function
__construct
(
private
string
$href
,
private
string
$text
,
private
?
string
$icon
=
null
,
private
?
MessageLocalizer
$localizer
=
null
,
private
?
string
$accessKeyHint
=
null
)
{
}
/**
* @inheritDoc
*/
public
function
getTemplateData
():
array
{
$localizer
=
$this
->
localizer
;
$accessKeyHint
=
$this
->
accessKeyHint
;
$additionalAttributes
=
[];
if
(
$localizer
)
{
$msg
=
$localizer
->
msg
(
$accessKeyHint
.
'-label'
);
if
(
$msg
->
exists
()
)
{
$additionalAttributes
[
'aria-label'
]
=
$msg
->
text
();
}
}
return
[
'href'
=>
$this
->
href
,
'icon'
=>
$this
->
icon
,
'text'
=>
$this
->
text
,
'array-attributes'
=>
[
[
'key'
=>
'href'
,
'value'
=>
$this
->
href
]
],
'html-attributes'
=>
$localizer
&&
$accessKeyHint
?
Html
::
expandAttributes
(
Linker
::
tooltipAndAccesskeyAttribs
(
$accessKeyHint
,
[],
[],
$localizer
)
+
$additionalAttributes
)
:
''
,
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 16 2026, 14:39 (11 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e2/94/1e2bd98e48cf04fbaa224667c0cb
Default Alt Text
CitizenComponentLink.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment