WowPress-Tailwind/theme/wowpress/Frontend/ToggleButton.php

54 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2024-04-16 15:25:22 +02:00
<?php
namespace WoWPress\Frontend;
class ToggleButton{
private $id;
public $row = true;
public $icons = true;
public $gray = true;
public $type = "checkbox";
public $name;
public $checked;
public $disabled;
public $text;
public $icon_yes = "o-check-badge";
public $icon_no = "o-no-symbol";
2024-04-23 00:44:42 +02:00
public $value = "";
2024-04-16 15:25:22 +02:00
public $color_yes = "monk";
public $color_no = "monk";
2024-04-26 17:47:19 +02:00
public $fullHeight = false;
2024-04-16 15:25:22 +02:00
public function __construct($args)
{
foreach($args as $key => $value){
if(property_exists(self::class,$key)){
$this->$key = $value;
}
if(!empty($args['color'])){
$this->color_yes = $args['color'];
$this->color_no = $args['color'];
}
if(empty($this->id)){
$this->id = uniqid();
}
if(empty($this->name)){
$this->name = uniqid();
}
}
}
public function render(){
2024-04-26 17:47:19 +02:00
require(get_template_directory()."/template-parts/components/toggle-button.php");
2024-04-16 15:25:22 +02:00
}
}