PHP code example of pageon / html-meta

1. Go to this page and download the library: Download pageon/html-meta library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pageon / html-meta example snippets


$meta = new Meta();

$meta->charset('UTF-8');
$meta->name('title', 'Hello World');
$meta->httpEquiv('Expires', '5000');
$meta->link('next', 'http://lorem.ipsum/?page=3');

$meta->title('Title');
$meta->description('My Description');
$meta->image('/path/to/image.jpeg');

class MyService 
{
    public function __construct(Meta $meta) {
        $meta->image($this->image->getThumbnail());
    }
}

$html = $meta->render();