modifs.mineures sans commentaires
This commit is contained in:
parent
b97515782b
commit
fbc70cb834
|
@ -7,12 +7,8 @@ use nulib\cl;
|
||||||
* Class content: gestionnaire de contenu (statique ou dynamique)
|
* Class content: gestionnaire de contenu (statique ou dynamique)
|
||||||
*/
|
*/
|
||||||
class content {
|
class content {
|
||||||
/**
|
/** quoter $vs si c'est un scalaire. sinon retourner le tableau tel quel */
|
||||||
* quoter $vs si c'est un scalaire. sinon retourner le tableau tel quel
|
static final function quote($contents): iterable {
|
||||||
*
|
|
||||||
* NB: cette méthode est accessible via la fonction globale {@link q()}
|
|
||||||
*/
|
|
||||||
static final function q($contents): iterable {
|
|
||||||
if ($contents === null || $contents === false) return [];
|
if ($contents === null || $contents === false) return [];
|
||||||
elseif ($contents instanceof IContent) return [$contents];
|
elseif ($contents instanceof IContent) return [$contents];
|
||||||
elseif ($contents instanceof IPrintable) return [$contents];
|
elseif ($contents instanceof IPrintable) return [$contents];
|
||||||
|
|
|
@ -16,7 +16,7 @@ class ATag implements IStaticContent {
|
||||||
function getContent(): iterable {
|
function getContent(): iterable {
|
||||||
return [
|
return [
|
||||||
"<$this->tag>",
|
"<$this->tag>",
|
||||||
...content::q($this->contents),
|
...content::quote($this->contents),
|
||||||
"</$this->tag>",
|
"</$this->tag>",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue