<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget; use ModStart\ModStart; class TextAction extends AbstractWidget { public static function getAssets() { return array('style' => '.ub-text-action{display:inline-block;margin-right:0.5rem;}'); } public static function __callStatic($rPkIY, $HPXJC) { goto SymEn; ZawD0: if (in_array($rPkIY, $XVuOQ)) { goto Gdm1t; DgedV: return $WwLCq->render(); goto UniVQ; zLPkC: $WwLCq->attr(empty($HPXJC[1]) ? '' : $HPXJC[1]); goto DgedV; DNAAO: $WwLCq->text($HPXJC[0]); goto zLPkC; Zg0eD: $WwLCq->type($rPkIY); goto DNAAO; Gdm1t: $WwLCq = new static(); goto Zg0eD; UniVQ: } goto H0_00; H0_00: throw new \Exception('TextAction error ' . join(',', $XVuOQ) . ' '); goto m5AaC; SymEn: $XVuOQ = array('primary', 'muted', 'warning', 'danger', 'success'); goto ZawD0; m5AaC: } public function render() { if ($this->disabled) { return '<a href="javascript:;" class="ub-text-action ub-text-muted">' . $this->text . '</span>'; } else { return '<a href="javascript:;" class="ub-text-action ub-text-' . ($this->type == 'primary' ? '' : $this->type) . '" ' . $this->attr . '>' . $this->text . '</span>'; } } }