Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5976601
MMLbase.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
MMLbase.php
View Options
<?php
namespace
MediaWiki\Extension\Math\WikiTexVC\MMLnodes
;
use
MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Tag
;
use
MediaWiki\Html\Html
;
class
MMLbase
{
private
string
$name
;
private
array
$attributes
;
public
function
__construct
(
string
$name
,
string
$texclass
=
''
,
array
$attributes
=
[]
)
{
$this
->
name
=
$name
;
$this
->
attributes
=
$attributes
;
if
(
$texclass
!==
''
)
{
$this
->
attributes
[
TAG
::
CLASSTAG
]
=
$texclass
;
}
}
public
function
name
():
string
{
return
$this
->
name
;
}
/**
* Encapsulating the input structure with start and end element
*
* @param string $input The raw HTML contents of the element: *not* escaped!
* @return string <tag> input </tag>
*/
public
function
encapsulateRaw
(
string
$input
):
string
{
return
HTML
::
rawElement
(
$this
->
name
,
$this
->
attributes
,
$input
);
}
/**
* Encapsulating the input with start and end element
*
* @param string $input
* @return string <tag> input </tag>
*/
public
function
encapsulate
(
string
$input
=
''
):
string
{
return
HTML
::
element
(
$this
->
name
,
$this
->
attributes
,
$input
);
}
/**
* Getting the start element
* @return string
*/
public
function
getStart
():
string
{
return
HTML
::
openElement
(
$this
->
name
,
$this
->
attributes
);
}
/**
* Gets an empty element with the specified name.
* Example: "<mrow/>"
* @return string
*/
public
function
getEmpty
():
string
{
return
substr
(
$this
->
getStart
(),
0
,
-
1
)
.
'/>'
;
}
/**
* Getting the end element
* @return string
*/
public
function
getEnd
():
string
{
return
HTML
::
closeElement
(
$this
->
name
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 19:16 (2 d, 1 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c6/48/41be5bfbf06454ebb40e96a09d15
Default Alt Text
MMLbase.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment