Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F455394
PhabricatorErrorUIExample.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
PhabricatorErrorUIExample.php
View Options
<?php
final
class
PhabricatorErrorUIExample
extends
PhabricatorUIExample
{
public
function
getName
()
{
return
'Errors'
;
}
public
function
getDescription
()
{
return
hsprintf
(
'Use <tt>AphrontErrorView</tt> to render errors, warnings and notices.'
);
}
public
function
renderExample
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$sevs
=
array
(
AphrontErrorView
::
SEVERITY_ERROR
=>
'Error'
,
AphrontErrorView
::
SEVERITY_WARNING
=>
'Warning'
,
AphrontErrorView
::
SEVERITY_NOTICE
=>
'Notice'
,
AphrontErrorView
::
SEVERITY_NODATA
=>
'No Data'
,
);
$views
=
array
();
foreach
(
$sevs
as
$sev
=>
$title
)
{
$view
=
new
AphrontErrorView
();
$view
->
setSeverity
(
$sev
);
$view
->
setTitle
(
$title
);
$view
->
appendChild
(
'Several issues were encountered.'
);
$view
->
setErrors
(
array
(
'Overcooked.'
,
'Too much salt.'
,
'Full of sand.'
,
));
$views
[]
=
$view
;
}
return
$views
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 6:57 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
69923
Default Alt Text
PhabricatorErrorUIExample.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment