PHP code example of pe / component-seo

1. Go to this page and download the library: Download pe/component-seo 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/ */

    

pe / component-seo example snippets


use PE\Component\SEO\Page;
use PE\Component\SEO\Renderer;

// In some place where page is identified
$page = new Page();

// In some place where SEO data is collected
$page->setTitle($seoTitle);
$page->setDescription($seoDescription);
$page->setKeywords($seoKeywords);

// In some place where SEO data is rendered
$renderer = new Renderer($page[, $charset = 'UTF-8']);
$renderer->renderTitle();
$renderer->renderMetas();
$renderer->renderLinks();