<?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(...$HPXJC) { goto WNGys; p4gw2: $WwLCq->link($HPXJC[2]); goto schjT; j6OQu: $WwLCq->text($HPXJC[1]); goto p4gw2; WNGys: $WwLCq = new static(); goto d3tCl; d3tCl: $WwLCq->type($HPXJC[0]); goto j6OQu; schjT: return $WwLCq; goto qAYG6; qAYG6: } public static function __callStatic($rPkIY, $HPXJC) { goto nCaKv; u3ktY: if (in_array($rPkIY, $XVuOQ)) { goto e9ZeN; zjRdM: $WwLCq->type($rPkIY); goto s3c1_; vtvTI: $WwLCq->link($HPXJC[1]); goto DUqQb; e9ZeN: $WwLCq = new static(); goto zjRdM; DUqQb: $WwLCq->attr(empty($HPXJC[2]) ? '' : $HPXJC[2]); goto GCEV_; GCEV_: return $WwLCq->render(); goto ulmkO; s3c1_: $WwLCq->text($HPXJC[0]); goto vtvTI; ulmkO: } goto kvnKY; kvnKY: throw new \Exception('TextLink error ' . join(',', $XVuOQ) . ' '); goto j1kaI; nCaKv: $XVuOQ = array('primary', 'muted', 'warning', 'danger', 'success'); goto u3ktY; j1kaI: } 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>'; } } }