<?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($STW4e) { $this->html = $STW4e; return $this; } public function htmlContent($STW4e) { $this->html = '<div class="ub-html">' . $STW4e . '</div>'; return $this; } public function htmlContentFromMarkdown($TUDHq) { goto Pxtg0; IcIDB: return $this; goto AVWXe; l7ufs: $this->html = '<div class="ub-html">' . $STW4e . '</div>'; goto IcIDB; Pxtg0: $STW4e = MarkdownUtil::convertToHtml($TUDHq); goto l7ufs; AVWXe: } public function htmlPlain($STW4e) { goto CGb6g; CGb6g: $this->html = $STW4e; goto vT2ok; vT2ok: $this->plain = true; goto Xxrfa; Xxrfa: return $this; goto kQt2w; kQt2w: } public function plain($LvcFI = true) { $this->plain = $LvcFI; return $this; } public function render() { goto I0kb8; mCc7V: if ($this->plain) { return $this->html; } goto xXCcU; PO6Iz: return "<div class=\"line\">\n    <div class=\"label\">\n        {$FKVQA}\n        {$y1zAr}\n    </div>\n    <div class=\"field\">\n        {$this->html}\n    </div>\n</div>"; goto GT1L9; xXCcU: $JXqZ3 = $this->rules(); goto sAB0h; b6OFH: $y1zAr = $this->label ? $this->label . ':' : ''; goto PO6Iz; I0kb8: if ($this->html instanceof \Closure) { $this->html = ConvertUtil::render($this->html->call($this->variables(), $this->context)); } goto mCc7V; sAB0h: $FKVQA = in_array('required', $JXqZ3) ? '<span class="ub-text-danger ub-text-bold">*</span>' : ''; goto b6OFH; GT1L9: } }