<?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($Q1WHV) { $this->html = $Q1WHV; return $this; } public function htmlContent($Q1WHV) { $this->html = '<div class="ub-html">' . $Q1WHV . '</div>'; return $this; } public function htmlContentFromMarkdown($Sx5j9) { goto PSWIU; wtAE2: $this->html = '<div class="ub-html">' . $Q1WHV . '</div>'; goto brfgq; brfgq: return $this; goto WhzNb; PSWIU: $Q1WHV = MarkdownUtil::convertToHtml($Sx5j9); goto wtAE2; WhzNb: } public function htmlPlain($Q1WHV) { goto i5WwE; WRYWo: $this->plain = true; goto fGlIN; i5WwE: $this->html = $Q1WHV; goto WRYWo; fGlIN: return $this; goto NFrEL; NFrEL: } public function plain($zkUOd = true) { $this->plain = $zkUOd; return $this; } public function render() { goto y9RZE; dS01F: $RN9uN = $this->rules(); goto bvJ5e; SK4p4: $Nvfoc = $this->label ? $this->label . ':' : ''; goto X8n1Y; y9RZE: if ($this->html instanceof \Closure) { $this->html = ConvertUtil::render($this->html->call($this->variables(), $this->context)); } goto drGDJ; bvJ5e: $FH30D = in_array('required', $RN9uN) ? '<span class="ub-text-danger ub-text-bold">*</span>' : ''; goto SK4p4; X8n1Y: return "<div class=\"line\">\n    <div class=\"label\">\n        {$FH30D}\n        {$Nvfoc}\n    </div>\n    <div class=\"field\">\n        {$this->html}\n    </div>\n</div>"; goto oN8Sn; drGDJ: if ($this->plain) { return $this->html; } goto dS01F; oN8Sn: } }