Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93604419
DivinerParameterTableView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 30, 02:36
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 02:36 (2 d)
Engine
blob
Format
Raw Data
Handle
22670956
Attached To
rPH Phabricator
DivinerParameterTableView.php
View Options
<?php
final
class
DivinerParameterTableView
extends
AphrontTagView
{
private
$parameters
;
private
$header
;
public
function
setParameters
(
array
$parameters
)
{
$this
->
parameters
=
$parameters
;
return
$this
;
}
public
function
setHeader
(
$text
)
{
$this
->
header
=
$text
;
return
$this
;
}
public
function
getTagName
()
{
return
'div'
;
}
public
function
getTagAttributes
()
{
return
array
(
'class'
=>
'diviner-table-view'
,
);
}
public
function
getTagContent
()
{
require_celerity_resource
(
'diviner-shared-css'
);
$rows
=
array
();
foreach
(
$this
->
parameters
as
$param
)
{
$cells
=
array
();
$type
=
idx
(
$param
,
'doctype'
);
if
(!
$type
)
{
$type
=
idx
(
$param
,
'type'
);
}
$name
=
idx
(
$param
,
'name'
);
$docs
=
idx
(
$param
,
'docs'
);
$cells
[]
=
phutil_tag
(
'td'
,
array
(
'class'
=>
'diviner-parameter-table-type diviner-monospace'
,
),
$type
);
$cells
[]
=
phutil_tag
(
'td'
,
array
(
'class'
=>
'diviner-parameter-table-name diviner-monospace'
,
),
$name
);
$cells
[]
=
phutil_tag
(
'td'
,
array
(
'class'
=>
'diviner-parameter-table-docs'
,
),
$docs
);
$rows
[]
=
phutil_tag
(
'tr'
,
array
(),
$cells
);
}
$table
=
phutil_tag
(
'table'
,
array
(
'class'
=>
'diviner-parameter-table-view'
),
$rows
);
$header
=
phutil_tag
(
'span'
,
array
(
'class'
=>
'diviner-table-header'
),
$this
->
header
);
return
array
(
$header
,
$table
);
}
}
Event Timeline
Log In to Comment