<?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($A1nut) { $this->html = $A1nut; return $this; } public function htmlContent($A1nut) { $this->html = '<div class="ub-html">' . $A1nut . '</div>'; return $this; } public function htmlContentFromMarkdown($ZS75D) { goto xTurY; ux_q3: $this->html = '<div class="ub-html">' . $A1nut . '</div>'; goto yZZV4; yZZV4: return $this; goto QbNuA; xTurY: $A1nut = MarkdownUtil::convertToHtml($ZS75D); goto ux_q3; QbNuA: } public function htmlPlain($A1nut) { goto k8Ysz; k8Ysz: $this->html = $A1nut; goto XpYE6; XpYE6: $this->plain = true; goto Ko5LE; Ko5LE: return $this; goto yggae; yggae: } public function plain($vBqty = true) { $this->plain = $vBqty; return $this; } public function render() { goto DB8xr; xE9b8: if ($this->plain) { return $this->html; } goto vyuqz; vyuqz: $lernV = $this->rules(); goto jIltd; DB8xr: if ($this->html instanceof \Closure) { $this->html = ConvertUtil::render($this->html->call($this->variables(), $this->context)); } goto xE9b8; jIltd: $XGd30 = in_array('required', $lernV) ? '<span class="ub-text-danger ub-text-bold">*</span>' : ''; goto zjXAi; JPHfB: return "<div class=\"line\">\n    <div class=\"label\">\n        {$XGd30}\n        {$rhrTz}\n    </div>\n    <div class=\"field\">\n        {$this->html}\n    </div>\n</div>"; goto JKAAc; zjXAi: $rhrTz = $this->label ? $this->label . ':' : ''; goto JPHfB; JKAAc: } }