Path: blob/master/src/view/page/AphrontPageView.php
12241 views
<?php12abstract class AphrontPageView extends AphrontView {34private $title;56public function setTitle($title) {7$this->title = $title;8return $this;9}1011public function getTitle() {12$title = $this->title;13if (is_array($title)) {14$title = implode(" \xC2\xB7 ", $title);15}16return $title;17}1819protected function getHead() {20return '';21}2223protected function getBody() {24return phutil_implode_html('', $this->renderChildren());25}2627protected function getTail() {28return '';29}3031protected function willRenderPage() {32return;33}3435protected function willSendResponse($response) {36return $response;37}3839protected function getBodyClasses() {40return null;41}4243public function render() {4445$this->willRenderPage();4647$title = $this->getTitle();48$head = $this->getHead();49$body = $this->getBody();50$tail = $this->getTail();5152$body_classes = $this->getBodyClasses();5354$body = phutil_tag(55'body',56array(57'class' => nonempty($body_classes, null),58),59array($body, $tail));6061if (PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) {62$data_fragment = phutil_safe_html(' data-developer-mode="1"');63} else {64$data_fragment = null;65}6667$response = hsprintf(68'<!DOCTYPE html>'.69'<html%s>'.70'<head>'.71'<meta charset="UTF-8" />'.72'<title>%s</title>'.73'%s'.74'</head>'.75'%s'.76'</html>',77$data_fragment,78$title,79$head,80$body);8182$response = $this->willSendResponse($response);8384return $response;8586}8788}899091