<?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(...$rxS2C) { goto lvXwV; lvXwV: $ZceHo = new static(); goto ow_z2; bzeOW: $ZceHo->link($rxS2C[2]); goto toios; xFDLi: $ZceHo->text($rxS2C[1]); goto bzeOW; toios: return $ZceHo; goto ktQ7B; ow_z2: $ZceHo->type($rxS2C[0]); goto xFDLi; ktQ7B: } public static function __callStatic($ZZMEd, $rxS2C) { goto lNxkY; lNxkY: $Rmgm_ = array('primary', 'muted', 'warning', 'danger', 'success'); goto iN7jy; iN7jy: if (in_array($ZZMEd, $Rmgm_)) { goto GN5NP; GN5NP: $ZceHo = new static(); goto ApuJh; juiLA: $ZceHo->link($rxS2C[1]); goto ZEAgG; mvq_1: $ZceHo->text($rxS2C[0]); goto juiLA; ApuJh: $ZceHo->type($ZZMEd); goto mvq_1; ZEAgG: $ZceHo->attr(empty($rxS2C[2]) ? '' : $rxS2C[2]); goto MgTV6; MgTV6: return $ZceHo->render(); goto Xytjm; Xytjm: } goto PBmDq; PBmDq: throw new \Exception('TextLink error ' . join(',', $Rmgm_) . ' '); goto SZVbC; SZVbC: } 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>'; } } }