<?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(...$CUZy6) { goto BH0vl; ya8_f: return $o5T8w; goto IwRx_; bqomm: $o5T8w->link($CUZy6[2]); goto ya8_f; gJJU1: $o5T8w->text($CUZy6[1]); goto bqomm; BH0vl: $o5T8w = new static(); goto mtGPD; mtGPD: $o5T8w->type($CUZy6[0]); goto gJJU1; IwRx_: } public static function __callStatic($L1g9F, $CUZy6) { goto eECeP; eECeP: $GdddG = array('primary', 'muted', 'warning', 'danger', 'success'); goto FOxzY; z5bfo: throw new \Exception('TextLink error ' . join(',', $GdddG) . ' '); goto F_E0E; FOxzY: if (in_array($L1g9F, $GdddG)) { goto AZ6vq; i0Lh_: $o5T8w->link($CUZy6[1]); goto w6MlN; W1gY1: $o5T8w->text($CUZy6[0]); goto i0Lh_; AZ6vq: $o5T8w = new static(); goto gN_lW; gN_lW: $o5T8w->type($L1g9F); goto W1gY1; whWkE: return $o5T8w->render(); goto O4SXE; w6MlN: $o5T8w->attr(empty($CUZy6[2]) ? '' : $CUZy6[2]); goto whWkE; O4SXE: } goto z5bfo; F_E0E: } 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>'; } } }