招标
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

44 lines
836 B

<?php
/**
*
* ListCreate.php
* User: ChenLong
* DateTime: 2020/3/18 14:07
*/
namespace sdModule\makeAdminBasics\htmlUnit;
class ListCreate implements ListUnitInterface
{
/**
* @return string
*/
public function event()
{
return 'create';
}
/**
* @param string $template
*/
public function register(string $template)
{
$code = "<button type=\"button\" lay-event=\"{$this->event()}\" class=\"layui-btn layui-btn-sm\"><i class=\"layui-icon layui-icon-add-1\"></i>{:lang('add')}</button>";
JsFacade::loadTemplate($this->event(), $code, $this->js(), $template);
}
/**
* @return string
*/
private function js()
{
return <<<JS
custom.frame('{:url("{$this->event()}")}', '{:lang("add")}{\$page_name ?: ""}');
JS;
}
}