igfs/kernel/IGTabel/btn/PrimaryBtn.php

24 lines
511 B
PHP
Raw Normal View History

2024-07-24 17:22:59 +03:00
<?php
namespace kernel\IGTabel\btn;
class PrimaryBtn
{
protected string $btn = '';
2024-12-19 12:53:55 +03:00
public function __construct(string $title, string $url, $width)
2024-07-24 17:22:59 +03:00
{
2024-12-23 14:16:00 +03:00
$this->btn = "<a class='btn btn-primary' href='$url' style='margin: 3px; width: $width;' >$title</a>";
2024-07-24 17:22:59 +03:00
}
public function fetch(): string
{
return $this->btn;
}
2024-12-19 12:53:55 +03:00
public static function create(string $title, string $url, $width = '150px'): PrimaryBtn
2024-07-24 17:22:59 +03:00
{
2024-12-19 12:53:55 +03:00
return new self($title, $url, $width);
2024-07-24 17:22:59 +03:00
}
}