PHP code example of tugrul / seo-bundle
1. Go to this page and download the library: Download tugrul/seo-bundle 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/ */
tugrul / seo-bundle example snippets
namespace App\MyProject\Field;
use Tug\SeoBundle\Field\{FieldData, FieldInterface};
use Tug\SeoBundle\Model\Meta as MetaModel;
class Robot implements FieldInterface
{
/**
* @inheritDoc
*/
public function getNamespace(): array
{
return ['my', 'robot'];
}
public function buildModels(FieldData $fieldData): iterable
{
$meta = new MetaModel();
$meta->setName('robot');
$meta->setContent($fieldData->getContent());
yield $meta;
}
}