<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget; use ModStart\ModStart; class TextAjaxRequest extends AbstractWidget { public static function getAssets() { return array('style' => '.ub-text-ajax-request{display:inline-block;margin-right:0.5rem;}'); } public static function make(...$lUGZC) { goto mSxUr; VueXL: $IEFeS->type($lUGZC[0]); goto Kwzhg; moJsq: return $IEFeS; goto pFZ6m; mSxUr: $IEFeS = new static(); goto VueXL; Kwzhg: $IEFeS->text($lUGZC[1]); goto Nloyv; Nloyv: $IEFeS->url($lUGZC[2]); goto moJsq; pFZ6m: } public static function __callStatic($XggBq, $lUGZC) { goto FZ0jo; FZ0jo: $T9vBG = array('primary', 'muted', 'warning', 'danger', 'success'); goto IT_FQ; IT_FQ: if (in_array($XggBq, $T9vBG)) { goto WateW; x9WxK: $IEFeS->url($lUGZC[1]); goto feRk6; Kvo54: $IEFeS->type($XggBq); goto BCnJQ; WateW: $IEFeS = new static(); goto Kvo54; feRk6: $IEFeS->confirm(empty($lUGZC[2]) ? '' : $lUGZC[2]); goto sDZoc; yPqav: return $IEFeS->render(); goto f0n8w; BCnJQ: $IEFeS->text($lUGZC[0]); goto x9WxK; sDZoc: $IEFeS->disabled(empty($lUGZC[3]) ? false : true); goto yPqav; f0n8w: } goto Ljtza; Ljtza: throw new \Exception('TextAjaxRequest error ' . join(',', $T9vBG) . ' '); goto lcVOX; lcVOX: } public function render() { if ($this->disabled) { return '<a href="javascript:;" class="ub-text-ajax-request ub-text-' . $this->type . '">' . $this->text . '</a>'; } else { return '<a href="javascript:;" ' . ($this->confirm ? 'data-confirm="' . $this->confirm . '"' : '') . ' data-ajax-request-loading data-ajax-request="' . $this->url . '" class="ub-text-ajax-request ub-text-' . $this->type . '" ' . ' ' . ($this->attr ? $this->attr : '') . '>' . $this->text . '</a>'; } } }