<?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($rFmqf) { goto akoKh; SKEFc: $this->addable(true); goto xb8LR; akoKh: $this->hookRendering(function (AbstractField $SQ6_6, $El_MH, $vTPD6) use($rFmqf) { return AutoRenderedFieldValue::make($rFmqf); }); goto SKEFc; xb8LR: return $this; goto Kr032; Kr032: } public function asLink($XwDKd, $qrjuT = true) { $this->hookRendering(function (AbstractField $SQ6_6, $El_MH, $vTPD6) use($XwDKd, $qrjuT) { if (preg_match_all('/\\{(.+?)\\}/', $XwDKd, $i5sAZ)) { foreach ($i5sAZ[1] as $eQWJY => $kh68j) { $lP9HM = ModelUtil::traverse($El_MH, $kh68j); $XwDKd = str_replace($i5sAZ[0][$eQWJY], $lP9HM, $XwDKd); } } $NcaQ2 = ModelUtil::traverse($El_MH, $SQ6_6->column()); $lSp6_ = array('<a href="', $XwDKd, '" target="_blank" ref="noreferrer noopener" ', $qrjuT ? 'target="_blank"' : '', '>', $qrjuT ? '<i class="iconfont icon-link"></i> ' : '', $NcaQ2, htmlspecialchars($NcaQ2), '</a>'); return AutoRenderedFieldValue::make(join('', $lSp6_)); }); return $this; } }