21 lines
490 B
PHP
21 lines
490 B
PHP
|
<?php
|
||
|
|
||
|
namespace Utils;
|
||
|
|
||
|
class Select {
|
||
|
/**
|
||
|
* Check if a given value is selected.
|
||
|
*
|
||
|
* @param mixed $ref The reference value to compare against.
|
||
|
* @param mixed $param The value to compare.
|
||
|
*
|
||
|
* @return string The string 'selected' if the values match, or an empty string otherwise.
|
||
|
*/
|
||
|
static function isSelected(string $ref, string $param): string {
|
||
|
if ($ref === $param) {
|
||
|
return 'selected';
|
||
|
}
|
||
|
return '';
|
||
|
}
|
||
|
}
|