Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F452483
PhabricatorFormExample.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
PhabricatorFormExample.php
View Options
<?php
final
class
PhabricatorFormExample
extends
PhabricatorUIExample
{
public
function
getName
()
{
return
'Form'
;
}
public
function
getDescription
()
{
return
hsprintf
(
'Use <tt>AphrontFormView</tt> to render forms.'
);
}
public
function
renderExample
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$start_time
=
id
(
new
AphrontFormDateControl
())
->
setUser
(
$user
)
->
setName
(
'start'
)
->
setLabel
(
'Start'
)
->
setInitialTime
(
AphrontFormDateControl
::
TIME_START_OF_BUSINESS
);
$start_value
=
$start_time
->
readValueFromRequest
(
$request
);
$end_time
=
id
(
new
AphrontFormDateControl
())
->
setUser
(
$user
)
->
setName
(
'end'
)
->
setLabel
(
'End'
)
->
setInitialTime
(
AphrontFormDateControl
::
TIME_END_OF_BUSINESS
);
$end_value
=
$end_time
->
readValueFromRequest
(
$request
);
$form
=
id
(
new
AphrontFormView
())
->
setUser
(
$user
)
->
setFlexible
(
true
)
->
appendChild
(
$start_time
)
->
appendChild
(
$end_time
)
->
appendChild
(
id
(
new
AphrontFormSubmitControl
())
->
setValue
(
'Submit'
));
return
$form
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 12:38 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68818
Default Alt Text
PhabricatorFormExample.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment