<?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(...$g59Hh) { goto fUndZ; LaoYh: $qRCHN->link($g59Hh[2]); goto Bl3i0; Bl3i0: return $qRCHN; goto vjaC1; DSPl2: $qRCHN->type($g59Hh[0]); goto llSdE; llSdE: $qRCHN->text($g59Hh[1]); goto LaoYh; fUndZ: $qRCHN = new static(); goto DSPl2; vjaC1: } public static function __callStatic($sQIr6, $g59Hh) { goto QwMra; X8H__: throw new \Exception('TextLink error ' . join(',', $KDM3X) . ' '); goto GwS9z; QwMra: $KDM3X = array('primary', 'muted', 'warning', 'danger', 'success'); goto wKpnX; wKpnX: if (in_array($sQIr6, $KDM3X)) { goto sXpCg; xRXSf: $qRCHN->type($sQIr6); goto Q7NHa; Ir33j: return $qRCHN->render(); goto xXo_9; sXpCg: $qRCHN = new static(); goto xRXSf; CHa34: $qRCHN->attr(empty($g59Hh[2]) ? '' : $g59Hh[2]); goto Ir33j; UhT_Q: $qRCHN->link($g59Hh[1]); goto CHa34; Q7NHa: $qRCHN->text($g59Hh[0]); goto UhT_Q; xXo_9: } goto X8H__; GwS9z: } 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>'; } } }