<?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($LTC5O) { goto H7b3D; H7b3D: $this->hookRendering(function (AbstractField $Mk6lP, $yFnpO, $dtpXv) use($LTC5O) { return AutoRenderedFieldValue::make($LTC5O); }); goto jeBN6; UwkjI: return $this; goto ol6Ai; jeBN6: $this->addable(true); goto UwkjI; ol6Ai: } public function asLink($EM9WQ = null, $lCYJ4 = true) { $this->hookRendering(function (AbstractField $Mk6lP, $yFnpO, $dtpXv) use($EM9WQ, $lCYJ4) { if (null !== $EM9WQ) { goto tI2yW; tI2yW: $V4zcu = $EM9WQ; goto HoyjD; HoyjD: if (preg_match_all('/\\{(.+?)\\}/', $V4zcu, $EbeBB)) { foreach ($EbeBB[1] as $Xn_Rr => $Fkd1C) { $pk5fc = ModelUtil::traverse($yFnpO, $Fkd1C); $V4zcu = str_replace($EbeBB[0][$Xn_Rr], $pk5fc, $V4zcu); } } goto es0Zf; es0Zf: $leAQ5 = ModelUtil::traverse($yFnpO, $Mk6lP->column()); goto lfkOG; lfkOG: } else { $V4zcu = ModelUtil::traverse($yFnpO, $Mk6lP->column()); $leAQ5 = $V4zcu; } if (!empty($leAQ5)) { $f6TlW = array('<a href="', $V4zcu, '" target="_blank" ref="noreferrer noopener" ', $lCYJ4 ? 'target="_blank"' : '', '>', $lCYJ4 ? '<i class="iconfont icon-link"></i> ' : '', htmlspecialchars($leAQ5), '</a>'); } else { $f6TlW = array(); } return AutoRenderedFieldValue::make(join('', $f6TlW)); }); return $this; } }