cosmos / metatag
A helpful library class for making HTML 'meta' tags.
v3.0.0
2020-01-04 03:52 UTC
Requires
- php: >=7.2.0
Requires (Dev)
- phpunit/phpunit: 8.5
This package is auto-updated.
Last update: 2025-01-04 17:07:46 UTC
README
A helpful library class for making HTML <meta>
tags.
Install
composer require cosmos/metatag
Usage
Basic
use Cosmos\MetaTag\MetaTag; $data = [ 'description' => "A helper class for making html meta tag.", 'author' => 'John', 'keywords' => ['PHP', 'Composer', 'Code', 'Github'] ]; $metaTag = new MetaTag($data); echo $metaTag->display(); // <meta property="description" content="A helper class for making html meta tag."> // <meta property="author" content="John"> // <meta property="keywords" content="PHP,Composer,Code,Github">
Access Properties
use Cosmos\MetaTag\MetaTag; $meta = new MetaTag($data); // add or modify properties. $meta->author = "James"; $meta->set('name', 'another content'); // get property. $name = $meta->get('name'); // remove property $meta->remove('name');