hyperf-view/builder/View/Grid/Tools/ToolButton.php

52 lines
927 B
PHP

<?php
declare(strict_types=1);
namespace Builder\View\Grid\Tools;
use Builder\View\Actions\BaseAction;
use Builder\View\Components\Attrs\Button;
class ToolButton extends BaseAction
{
use Button;
protected $uri;
protected $componentName = "ToolButton";
protected $handler;
public function __construct($content)
{
$this->content = $content;
}
/**
* @param string $content 按钮内容
* @return ToolButton
*/
public static function make($content)
{
return new ToolButton($content);
}
/**
* @param mixed $uri
* @return $this
*/
public function uri($uri)
{
$this->uri = $uri;
return $this;
}
/**
* @param string $handler 响应类型 request|route|link
* @return $this
*/
public function handler($handler)
{
$this->handler = $handler;
return $this;
}
}