<?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(...$nvZ9A) { goto iVkIe; iVkIe: $fNHhl = new static(); goto knkHk; knkHk: $fNHhl->type($nvZ9A[0]); goto uE9wO; uE9wO: $fNHhl->text($nvZ9A[1]); goto yl6Qa; yl6Qa: $fNHhl->link($nvZ9A[2]); goto aNNEr; aNNEr: return $fNHhl; goto uReT4; uReT4: } public static function __callStatic($L4owo, $nvZ9A) { goto A9wqy; A9wqy: $Ai6oc = array('primary', 'muted', 'warning', 'danger', 'success'); goto gcKKC; DKfhW: throw new \Exception('TextLink error ' . join(',', $Ai6oc) . ' '); goto Jj1T2; gcKKC: if (in_array($L4owo, $Ai6oc)) { goto N5vCO; N5vCO: $fNHhl = new static(); goto shGK9; shGK9: $fNHhl->type($L4owo); goto Zdwix; iw9zt: $fNHhl->link($nvZ9A[1]); goto xK8gl; xK8gl: $fNHhl->attr(empty($nvZ9A[2]) ? '' : $nvZ9A[2]); goto TO12w; TO12w: return $fNHhl->render(); goto yi_xc; Zdwix: $fNHhl->text($nvZ9A[0]); goto iw9zt; yi_xc: } goto DKfhW; Jj1T2: } 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>'; } } }