hyperf-view/builder/View/Grid/Actions/ActionLink.php

47 lines
897 B
PHP

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