lastcomments

This commit is contained in:
kali 2024-03-15 14:33:31 +03:00
parent 0596fa6d55
commit 6e62ce7363
4 changed files with 51 additions and 0 deletions

View File

@ -4,12 +4,21 @@ namespace src\debug;
class Debug
{
/**
* @param $content
* @return void
*/
public static function prn($content)
{
echo '<pre style="background: lightgray; border: 1px solid black; padding: 2px">';
print_r($content);
echo '</pre>';
}
/**
* @param $content
* @return void
*/
public static function dd($content)
{
echo '<pre style="background: lightgray; border: 1px solid black; padding: 2px">';

View File

@ -11,6 +11,11 @@ class Button
private string $value;
private array $paramsArray;
/**
* @param string $name
* @param string $value
* @param array $paramsArray
*/
public function __construct(string $name, string $value, array $paramsArray = [])
{
$this->name = $name;
@ -18,12 +23,21 @@ class Button
$this->value = $value;
}
/**
* @return void
*/
public function create(): void
{
$paramsString = $this->createParams($this->paramsArray);
echo "<button name='$this->name' $paramsString>$this->value</button>";
}
/**
* @param string $name
* @param string $value
* @param array $paramsArray
* @return void
*/
public static function build(string $name, string $value, array $paramsArray = []): void
{
$input = new self($name, $value, $paramsArray);

View File

@ -12,18 +12,33 @@ class Checkbox
private string $value;
private array $paramsArray;
/**
* @param string $name
* @param string $value
* @param array $paramsArray
*/
public function __construct(string $name, string $value, array $paramsArray = [])
{
$this->name = $name;
$this->value = $value;
$this->paramsArray = $paramsArray;
}
/**
* @return void
*/
public function create(): void
{
$paramsString = $this->createParams($this->paramsArray);
echo "<input name='$this->name' type='checkbox' value='$this->value' $paramsString >";
}
/**
* @param string $name
* @param string $value
* @param array $paramsArray
* @return void
*/
public static function build(string $name, string $value, array $paramsArray): void
{
$checkbox = new self($name, $value, $paramsArray);

View File

@ -10,12 +10,20 @@ class Label
private string $title;
private array $paramsArray;
/**
* @param string $title
* @param array $paramsArray
*/
public function __construct(string $title, array $paramsArray = [])
{
$this->title = $title;
$this->paramsArray = $paramsArray;
}
/**
* @return void
*/
public function create(): void
{
$paramsString = $this->createParams($this->paramsArray);
@ -23,6 +31,11 @@ class Label
}
/**
* @param string $title
* @param array $paramsArray
* @return void
*/
public static function build(string $title, array $paramsArray = [])
{
$label = new self($title, $paramsArray);