<?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($L4owo, $nvZ9A) { goto U3y6f; DgbSl: if (in_array($L4owo, $Ai6oc)) { goto rmx4x; jncB2: return $fNHhl->render(); goto JMRrd; aiE1P: $fNHhl->attr(empty($nvZ9A[1]) ? '' : $nvZ9A[1]); goto jncB2; rmx4x: $fNHhl = new static(); goto sdXmu; sdXmu: $fNHhl->type($L4owo); goto LAmdJ; LAmdJ: $fNHhl->text($nvZ9A[0]); goto aiE1P; JMRrd: } goto HFAsa; HFAsa: throw new \Exception('TextAction error ' . join(',', $Ai6oc) . ' '); goto MSKkW; U3y6f: $Ai6oc = array('primary', 'muted', 'warning', 'danger', 'success'); goto DgbSl; MSKkW: } 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>'; } } }