<?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($oAyDf) { $this->html = $oAyDf; return $this; } public function htmlContent($oAyDf) { $this->html = '<div class="ub-html">' . $oAyDf . '</div>'; return $this; } public function htmlContentFromMarkdown($j4Fga) { goto pk5Mo; pk5Mo: $oAyDf = MarkdownUtil::convertToHtml($j4Fga); goto IvF9v; IvF9v: $this->html = '<div class="ub-html">' . $oAyDf . '</div>'; goto hzDB8; hzDB8: return $this; goto at7hG; at7hG: } public function htmlPlain($oAyDf) { goto aTABx; Jp2G0: $this->plain = true; goto AQ069; AQ069: return $this; goto YzgIj; aTABx: $this->html = $oAyDf; goto Jp2G0; YzgIj: } public function plain($rEotR = true) { $this->plain = $rEotR; return $this; } public function render() { goto FNs8v; bEQ0P: $hYLy4 = $this->rules(); goto eE9TA; yDWLA: if ($this->plain) { return $this->html; } goto bEQ0P; FNs8v: if ($this->html instanceof \Closure) { $this->html = ConvertUtil::render($this->html->call($this->variables(), $this->context)); } goto yDWLA; eE9TA: $NB4Pr = in_array('required', $hYLy4) ? '<span class="ub-text-danger ub-text-bold">*</span>' : ''; goto xrUjA; xrUjA: $ob1v7 = $this->label ? $this->label . ':' : ''; goto Sv7Zl; Sv7Zl: return "<div class=\"line\">\n    <div class=\"label\">\n        {$NB4Pr}\n        {$ob1v7}\n    </div>\n    <div class=\"field\">\n        {$this->html}\n    </div>\n</div>"; goto g1XG1; g1XG1: } }