<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Layout; use Closure; use Illuminate\Contracts\Support\Renderable; use Illuminate\Support\Arr; class Page implements Renderable { private $pageTitle = ' '; private $pageKeywords = ''; private $pageDescription = ''; private $rows = array(); protected $view; private $viewData = array(); public function __construct(\Closure $l2aoe = null) { if ($l2aoe instanceof Closure) { $l2aoe($this); } } public function body($xMSF0) { return $this->row($xMSF0); } public function row($xMSF0) { if ($xMSF0 instanceof Closure) { goto lZJDk; lZJDk: $hEabj = new Row(); goto w7FYK; Bgi55: $this->addRow($hEabj); goto iTOyV; w7FYK: call_user_func($xMSF0, $hEabj); goto Bgi55; iTOyV: } else { $this->addRow(new Row($xMSF0)); } return $this; } public function append($xMSF0) { $this->rows[] = $xMSF0; return $this; } public function view($cBZiy = null) { goto BULjZ; BULjZ: if (null === $cBZiy) { return $this->view; } goto jaT8_; jaT8_: $this->view = $cBZiy; goto hRJwt; hRJwt: return $this; goto wL8Kz; wL8Kz: } public function putViewData($ce0rD, $tzAUI = null) { if (is_array($ce0rD)) { $this->viewData = array_merge($this->viewData, $ce0rD); } else { $this->viewData[$ce0rD] = $tzAUI; } return $this; } public function pageTitle($zJ7wA = null) { goto kUATW; f3NwX: $this->pageTitle = $zJ7wA; goto ZNFgR; ZNFgR: return $this; goto cpPXy; kUATW: if (null === $zJ7wA) { return $this->pageTitle; } goto f3NwX; cpPXy: } public function pageKeywords($BjHPZ = null) { goto C3wjc; QY_j1: return $this; goto AT0_H; C3wjc: if (null === $BjHPZ) { if (empty($this->pageKeywords)) { return $this->pageTitle(); } return $this->pageKeywords; } goto yvqjR; yvqjR: $this->pageKeywords = $BjHPZ; goto QY_j1; AT0_H: } public function pageDescription($RNn0Y = null) { goto igFl0; la47i: $this->pageDescription = $RNn0Y; goto EQQVN; EQQVN: return $this; goto SX3fR; igFl0: if (null === $RNn0Y) { if (empty($this->pageDescription)) { return $this->pageTitle(); } return $this->pageDescription; } goto la47i; SX3fR: } private function addRow(Row $hEabj) { $this->rows[] = $hEabj; } public function build() { goto bC3bA; GBsXs: foreach ($this->rows as $hEabj) { if ($hEabj instanceof Buildable) { $hEabj->build(); } else { echo $hEabj; } } goto QWl_1; LNNzN: ob_end_clean(); goto wubps; wubps: return $uWK2G; goto bZ13w; bC3bA: ob_start(); goto GBsXs; QWl_1: $uWK2G = ob_get_contents(); goto LNNzN; bZ13w: } public function render() { $Y0YxF = array('pageTitle' => $this->pageTitle(), 'pageKeywords' => $this->pageKeywords(), 'pageDescription' => $this->pageDescription(), 'content' => $this->build()); return view($this->view(), array_merge($Y0YxF, $this->viewData))->render(); } }