mirror of
https://github.com/Aviortheking/Blog_IMIE.git
synced 2025-04-23 19:32:15 +00:00
WIP on tags reation & handling
This commit is contained in:
parent
04a2780bdc
commit
4d44b671a4
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ package-lock.json
|
|||||||
.vscode/
|
.vscode/
|
||||||
build/
|
build/
|
||||||
ops/terraform/secrets.tf
|
ops/terraform/secrets.tf
|
||||||
|
.DS_Store
|
50
project/assets/php/tagHandler.php
Normal file
50
project/assets/php/tagHandler.php
Normal 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>
|
Loading…
x
Reference in New Issue
Block a user