<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget; use ModStart\ModStart; class TextLink extends AbstractWidget { public static function getAssets() { return array('style' => '.ub-text-link{display:inline-block;margin-right:0.5rem;}'); } public static function make(...$lUGZC) { goto ibSwv; ibSwv: $IEFeS = new static(); goto O0zAr; n1fMR: $IEFeS->text($lUGZC[1]); goto HAUzC; O0zAr: $IEFeS->type($lUGZC[0]); goto n1fMR; ue_2D: return $IEFeS; goto V_qA5; HAUzC: $IEFeS->link($lUGZC[2]); goto ue_2D; V_qA5: } public static function __callStatic($XggBq, $lUGZC) { goto gq4xC; KvBQ6: if (in_array($XggBq, $T9vBG)) { goto LbQu0; dp1Jk: $IEFeS->type($XggBq); goto CsU5f; B1mGJ: $IEFeS->attr(empty($lUGZC[2]) ? '' : $lUGZC[2]); goto ImnOT; TReF_: $IEFeS->link($lUGZC[1]); goto B1mGJ; LbQu0: $IEFeS = new static(); goto dp1Jk; CsU5f: $IEFeS->text($lUGZC[0]); goto TReF_; ImnOT: return $IEFeS->render(); goto LoVh1; LoVh1: } goto r08J7; gq4xC: $T9vBG = array('primary', 'muted', 'warning', 'danger', 'success'); goto KvBQ6; r08J7: throw new \Exception('TextLink error ' . join(',', $T9vBG) . ' '); goto Iag8y; Iag8y: } public function render() { if ($this->disabled) { return '<a href="javascript:;" class="ub-text-link ub-text-muted">' . $this->text . '</a>'; } else { return '<a href="' . $this->link . '" class="ub-text-link ub-text-' . ($this->type == 'primary' ? 'link' : $this->type) . '" ' . $this->attr . '>' . $this->text . '</a>'; } } }