32 lines
726 B
PHP
32 lines
726 B
PHP
<?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;
|
|
}
|
|
}
|