<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; use ModStart\Core\Util\ConvertUtil; use Module\Vendor\Markdown\MarkdownUtil; class Html extends AbstractField { protected $html = ''; protected $plain = false; protected $isLayoutField = true; public function html($YUOG2) { $this->html = $YUOG2; return $this; } public function htmlContent($YUOG2) { $this->html = '<div class="ub-html">' . $YUOG2 . '</div>'; return $this; } public function htmlContentFromMarkdown($YQ3HX) { goto TiIdb; FP3hN: $this->html = '<div class="ub-html">' . $YUOG2 . '</div>'; goto Qxsjt; TiIdb: $YUOG2 = MarkdownUtil::convertToHtml($YQ3HX); goto FP3hN; Qxsjt: return $this; goto hD5QE; hD5QE: } public function htmlPlain($YUOG2) { goto LQsV1; LQsV1: $this->html = $YUOG2; goto p5jKd; lAq5A: return $this; goto DjDSO; p5jKd: $this->plain = true; goto lAq5A; DjDSO: } public function plain($NYf3F = true) { $this->plain = $NYf3F; return $this; } public function render() { goto ngfs0; nILOn: if ($this->plain) { return $this->html; } goto ulAkq; Klx0A: $Mbkw5 = $this->label ? $this->label . ':' : ''; goto me9gJ; vgSA_: $no3EH = in_array('required', $rwR_N) ? '<span class="ub-text-danger ub-text-bold">*</span>' : ''; goto Klx0A; ulAkq: $rwR_N = $this->rules(); goto vgSA_; ngfs0: if ($this->html instanceof \Closure) { $this->html = ConvertUtil::render($this->html->call($this->variables(), $this->context)); } goto nILOn; me9gJ: return "<div class=\"line\">\n    <div class=\"label\">\n        {$no3EH}\n        {$Mbkw5}\n    </div>\n    <div class=\"field\">\n        {$this->html}\n    </div>\n</div>"; goto QkHYb; QkHYb: } }