Skip to content

(yet-another) PHP class for generating HTML code

License

Notifications You must be signed in to change notification settings

pegasusict/html-generator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tags

(yet-another) PHP class for generating HTML tags.

example of usage

####construction of Tags object

$tags = new Tags();

no dependencies at all... do not pass any arguments!

####generating a link.

echo $tags->a( 'link' )->href( 'tags.php' );
// <a href="tags.php">link</a>

####nested/structured tags: ul > li

$ul = $tags->ul(
  $tags->li( 'list #1' ),
  $tags->li( $tags->img()->src( 'img.gif' ) ),
  'just a text'
);
echo $ul;
/*
<ul>
    <li>list #1</li>
    <li><img src="img.gif" /></li>
    just a text
</ul>
*/

one object for a tag.

please note that img tag has no ending tags. tags, such as img, input, br, has no body.

see more examples in examples.php.

License

The MIT License (MIT)

About

(yet-another) PHP class for generating HTML code

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%