<?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($f6TlW) { $this->html = $f6TlW; return $this; } public function htmlContent($f6TlW) { $this->html = '<div class="ub-html">' . $f6TlW . '</div>'; return $this; } public function htmlContentFromMarkdown($WHNtC) { goto foDGk; l5GjX: return $this; goto NWdGB; foDGk: $f6TlW = MarkdownUtil::convertToHtml($WHNtC); goto HNNOy; HNNOy: $this->html = '<div class="ub-html">' . $f6TlW . '</div>'; goto l5GjX; NWdGB: } public function htmlPlain($f6TlW) { goto KSq3s; KSq3s: $this->html = $f6TlW; goto KjqZP; frYs9: return $this; goto gp1C4; KjqZP: $this->plain = true; goto frYs9; gp1C4: } public function plain($eaAcf = true) { $this->plain = $eaAcf; return $this; } public function render() { goto q3vom; xhUeC: return "<div class=\"line\">\n    <div class=\"label\">\n        {$ViapG}\n        {$ldmKg}\n    </div>\n    <div class=\"field\">\n        {$this->html}\n    </div>\n</div>"; goto c2rDt; mviKd: $vt58Q = $this->rules(); goto eLaP3; q3vom: if ($this->html instanceof \Closure) { $this->html = ConvertUtil::render($this->html->call($this->variables(), $this->context)); } goto zNGj2; zNGj2: if ($this->plain) { return $this->html; } goto mviKd; Qe5xH: $ldmKg = $this->label ? $this->label . ':' : ''; goto xhUeC; eLaP3: $ViapG = in_array('required', $vt58Q) ? '<span class="ub-text-danger ub-text-bold">*</span>' : ''; goto Qe5xH; c2rDt: } }