3 final class PhortuneProductViewController
extends PhortuneController
{
5 public function handleRequest(AphrontRequest
$request) {
6 $viewer = $request->getViewer();
7 $id = $request->getURIData('id');
9 $product = id(new PhortuneProductQuery())
14 return new Aphront404Response();
17 $title = pht('Product: %s', $product->getProductName());
19 $header = id(new PHUIHeaderView())
20 ->setHeader($product->getProductName())
21 ->setHeaderIcon('fa-gift');
23 $edit_uri = $this->getApplicationURI('product/edit/'.$product->getID().'/');
25 $crumbs = $this->buildApplicationCrumbs();
26 $crumbs->addTextCrumb(
28 $this->getApplicationURI('product/'));
29 $crumbs->addTextCrumb(
30 pht('#%d', $product->getID()),
31 $request->getRequestURI());
32 $crumbs->setBorder(true);
34 $properties = id(new PHUIPropertyListView())
38 $product->getPriceAsCurrency()->formatForDisplay());
40 $object_box = id(new PHUIObjectBoxView())
41 ->setHeaderText(pht('Details'))
42 ->setBackground(PHUIObjectBoxView
::BLUE_PROPERTY
)
43 ->addPropertyList($properties);
45 $view = id(new PHUITwoColumnView())
51 return $this->newPage()