<?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 __callStatic($TUuqF, $MVaFK) { goto i_BEd; i_BEd: $U0Xav = array('primary', 'muted', 'warning', 'danger', 'success'); goto eKzA8; aSukm: throw new \Exception('TextLink error ' . join(',', $U0Xav) . ' '); goto DLgzY; eKzA8: if (in_array($TUuqF, $U0Xav)) { goto iRLXk; iRLXk: $xU_gb = new static(); goto HBhPy; JDVGN: return $xU_gb->render(); goto Yp67a; ADOne: $xU_gb->attr(empty($MVaFK[2]) ? '' : $MVaFK[2]); goto JDVGN; g_wPj: $xU_gb->link($MVaFK[1]); goto ADOne; HBhPy: $xU_gb->type($TUuqF); goto shofB; shofB: $xU_gb->text($MVaFK[0]); goto g_wPj; Yp67a: } goto aSukm; DLgzY: } 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 . '" ' . $this->attr . '>' . $this->text . '</a>'; } } }