<?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($eAyzj) { $this->html = $eAyzj; return $this; } public function htmlContent($eAyzj) { $this->html = '<div class="ub-html">' . $eAyzj . '</div>'; return $this; } public function htmlContentFromMarkdown($tR5UV) { goto ICy68; ICy68: $eAyzj = MarkdownUtil::convertToHtml($tR5UV); goto K0nf0; hF8vz: return $this; goto Xejk5; K0nf0: $this->html = '<div class="ub-html">' . $eAyzj . '</div>'; goto hF8vz; Xejk5: } public function htmlPlain($eAyzj) { goto dtmje; HP7HZ: $this->plain = true; goto k5dFg; dtmje: $this->html = $eAyzj; goto HP7HZ; k5dFg: return $this; goto lUhsH; lUhsH: } public function plain($JEY07 = true) { $this->plain = $JEY07; return $this; } public function render() { goto azoYH; sexJG: return "<div class=\"line\">\n    <div class=\"label\">\n        {$L4ilK}\n        {$JqDEI}\n    </div>\n    <div class=\"field\">\n        {$this->html}\n    </div>\n</div>"; goto Qk7Mi; UbzZ6: $L4ilK = in_array('required', $V_snk) ? '<span class="ub-text-danger ub-text-bold">*</span>' : ''; goto BLchg; OQYmB: if ($this->plain) { return $this->html; } goto z_EDa; z_EDa: $V_snk = $this->rules(); goto UbzZ6; azoYH: if ($this->html instanceof \Closure) { $this->html = ConvertUtil::render($this->html->call($this->variables(), $this->context)); } goto OQYmB; BLchg: $JqDEI = $this->label ? $this->label . ':' : ''; goto sexJG; Qk7Mi: } }