WIP on tags reation & handling

This commit is contained in:
Florian Bouillon 2018-11-19 16:50:41 +01:00
parent 04a2780bdc
commit 4d44b671a4
2 changed files with 51 additions and 0 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ package-lock.json
.vscode/
build/
ops/terraform/secrets.tf
.DS_Store

View File

@ -0,0 +1,50 @@
<?php
/**
* <tag type="pokemon" arg="pokemongo"><div class="pokemon-item"></div></tag>
*/
class tag {
private $DOM = "<div>Please, edit it !</div>";
private $attr = array();
public function __construct(array $attributes = array(), String $DOMContent= "") {
$this->attr = array_merge($this->attr, $attributes);
$this->DOM = $DOMContent;
}
private function process() {
return $this->DOM;
}
public function render() {
return $this->process();
}
}
class loop extends tag {
private function process() {
return "<div>pokemon</div>";
}
}
$tag = new tag();
$loop = new loop();
echo $tag->render();
echo $loop->render();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<tag type="tag"></tag>
<tag type="loop"></tag>
</body>
</html>