PHP code example of fokke / markup-metadata

1. Go to this page and download the library: Download fokke/markup-metadata 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/ */

    

fokke / markup-metadata example snippets


// Initialize module instance
$metadata = $modules->get('MarkupMetadata');

// Optionally set your custom meta tags, or overwrite module configuration before rendering...

// Render metadata
echo $metadata->render();

$metadata->setMeta('meta', [
  'name' => 'author',
  'content' => 'Jerry Cotton',
]);
// <meta name="author" content="Jerry Cotton">

$metadata->render();

// Add this line before rendering
$metadata->site_name = 'My custom site name';

// Set multiple properties
$metadata->setArray([
  'page_title' => 'My custom title',
  'site_name' => 'My custom site name',
  'description' => 'My custom description',
]);