<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; use ModStart\Core\Dao\ModelUtil; class Display extends AbstractField { protected $addable = false; protected $editable = false; public function content($gP2DQ) { goto KUbcj; whHCp: return $this; goto CkOxz; KUbcj: $this->hookRendering(function (AbstractField $Ldet7, $P1uVJ, $C6OV7) use($gP2DQ) { return AutoRenderedFieldValue::make($gP2DQ); }); goto DB7Ym; DB7Ym: $this->addable(true); goto whHCp; CkOxz: } public function asLink($OrwWm = null, $buza9 = true) { $this->hookRendering(function (AbstractField $Ldet7, $P1uVJ, $C6OV7) use($OrwWm, $buza9) { if (null !== $OrwWm) { goto ZxGIs; ZxGIs: $WrHyc = $OrwWm; goto Wkxfs; R7bE4: $IA_o1 = ModelUtil::traverse($P1uVJ, $Ldet7->column()); goto IE_kZ; Wkxfs: if (preg_match_all('/\\{(.+?)\\}/', $WrHyc, $YANPA)) { foreach ($YANPA[1] as $jqibn => $lxIPA) { $knQyJ = ModelUtil::traverse($P1uVJ, $lxIPA); $WrHyc = str_replace($YANPA[0][$jqibn], $knQyJ, $WrHyc); } } goto R7bE4; IE_kZ: } else { $WrHyc = ModelUtil::traverse($P1uVJ, $Ldet7->column()); $IA_o1 = $WrHyc; } if (!empty($IA_o1)) { $eAyzj = array('<a href="', $WrHyc, '" target="_blank" ref="noreferrer noopener" ', $buza9 ? 'target="_blank"' : '', '>', $buza9 ? '<i class="iconfont icon-link"></i> ' : '', htmlspecialchars($IA_o1), '</a>'); } else { $eAyzj = array(); } return AutoRenderedFieldValue::make(join('', $eAyzj)); }); return $this; } }