Skip to content
/ OTag Public

A simple tag object that supports nesting and referable containers.

License

Notifications You must be signed in to change notification settings

tyson-nw/OTag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTag

A simple tag object that supports nesting and referencable containers.

The goal is to take in the minimum amount of input to create the maximum amount of well formatted HTML without having to worry about closing tags or accidentally creating infinite loops of objects.

Some Standard syntaxes for createing tags are:

<?php
$div = new Tag("div", array("id"=>"main","class"=>"blurb content");
$div->add($head = Tag::Craft("h1", "OTag has these");
$features = array("Object Oriented","nesting","expandable syntax", "prevent infinite reference loops","takes html");
$div->add($ul = new Tag("ul");
$n = 0;
foreach($features as $f){
	$ul->add("<li>$f</li>");
	$n++;
}
$head->add("$n features");
$head->inline();
echo $div;

OUTPUTS

<div id='main' class='blurb content'>
	<h1>OTag has these 5 features</h1>
	<ul>
		<li>Object Oriented</li>
		<li>nesting</li>
		<li>expandable syntax</li>
		<li>prevent infinite reference loops</li>
		<li>takes html</li>
	</ul>
</div>

About

A simple tag object that supports nesting and referable containers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published