nur-sery/nur_src/v/bs3/_container.php

32 lines
726 B
PHP
Raw Normal View History

2023-12-03 22:10:18 +04:00
<?php
namespace nur\v\bs3;
use nur\b\ValueException;
/**
* Class _container: outils pour gérer les containers
*/
class _container {
const CONTAINER_FLUID = "container-fluid";
const CONTAINER_NORMAL = "container";
static final function get_class(?string $container): string {
if ($container === null) $container = self::CONTAINER_NORMAL;
switch ($container) {
case self::CONTAINER_FLUID:
case "fluid":
case "f":
$class = self::CONTAINER_FLUID;
break;
case self::CONTAINER_NORMAL:
case "normal":
case "n":
$class = self::CONTAINER_NORMAL;
break;
default:
throw new ValueException("$container: invalid container type");
}
return $class;
}
}