<?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(...$bY7Wp) { goto iDlqy; eidFq: $bMeyO->type($bY7Wp[0]); goto tQzka; tQzka: $bMeyO->text($bY7Wp[1]); goto yuptA; wgWXR: return $bMeyO; goto OKhd1; yuptA: $bMeyO->link($bY7Wp[2]); goto wgWXR; iDlqy: $bMeyO = new static(); goto eidFq; OKhd1: } public static function __callStatic($glP3G, $bY7Wp) { goto eIo9J; J8gVC: if (in_array($glP3G, $DslRv)) { goto hVEhJ; hVEhJ: $bMeyO = new static(); goto wABxK; wABxK: $bMeyO->type($glP3G); goto LqCHT; wJ1dK: return $bMeyO->render(); goto KLnko; Ehwei: $bMeyO->attr(empty($bY7Wp[2]) ? '' : $bY7Wp[2]); goto wJ1dK; aUtHW: $bMeyO->link($bY7Wp[1]); goto Ehwei; LqCHT: $bMeyO->text($bY7Wp[0]); goto aUtHW; KLnko: } goto HahsO; HahsO: throw new \Exception('TextLink error ' . join(',', $DslRv) . ' '); goto HwYMz; eIo9J: $DslRv = array('primary', 'muted', 'warning', 'danger', 'success'); goto J8gVC; HwYMz: } 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>'; } } }