<?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(...$RSGSj) { goto Myiro; SQCn8: return $BoHUj; goto kH1n2; Dt2o5: $BoHUj->text($RSGSj[1]); goto u4qUO; u4qUO: $BoHUj->link($RSGSj[2]); goto SQCn8; IItc_: $BoHUj->type($RSGSj[0]); goto Dt2o5; Myiro: $BoHUj = new static(); goto IItc_; kH1n2: } public static function __callStatic($f0dxO, $RSGSj) { goto HhQ3t; HhQ3t: $eElQG = array('primary', 'muted', 'warning', 'danger', 'success'); goto qUnla; qUnla: if (in_array($f0dxO, $eElQG)) { goto M0PZL; AV82X: $BoHUj->text($RSGSj[0]); goto eYUYT; M0PZL: $BoHUj = new static(); goto Bv6sp; WNLFx: $BoHUj->attr(empty($RSGSj[2]) ? '' : $RSGSj[2]); goto wlckI; eYUYT: $BoHUj->link($RSGSj[1]); goto WNLFx; Bv6sp: $BoHUj->type($f0dxO); goto AV82X; wlckI: return $BoHUj->render(); goto UjwFm; UjwFm: } goto ZCdZa; ZCdZa: throw new \Exception('TextLink error ' . join(',', $eElQG) . ' '); goto UQSfH; UQSfH: } 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>'; } } }