Files
xk-api-yii/admin/components/UI/Form/Url.php
2024-09-19 11:32:39 +08:00

38 lines
786 B
PHP

<?php
namespace admin\components\UI\Form;
/**
* url输入
* @package backend\components\UI\Form
*/
class Url extends Element implements Component
{
protected Text $object;
/**
* Text constructor.
* @param string $name
* @param string $field
* @param string $has
*/
public function __construct(string $name, string $field, string $has = '')
{
$this->name = $name;
$this->field = $field;
$this->has = $has;
$this->object = new Text($this->name, $this->field, $this->has);
$this->object->beforeText('http(s)');
}
/**
* @return array
*/
public function render(): array
{
$this->object->attrArray($this->attr);
return $this->object->getRender();
}
}