1. Go to this page and download the library: Download lch/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/ */
lch / seo-bundle example snippets
use Lch\SeoBundle\Behaviour\Seoable;
use Lch\SeoBundle\Model\SeoInterface;
class MyEntity implements SeoInterface
{
use Seoable;
...
/**
* @inheritdoc
*/
public function getSluggableFields()
{
// This assume your entity have a field 'title'
return [
'title'
];
}
/**
* @inheritdoc
*/
public function getRouteFields()
{
return [
'slug' => 'slug'
];
}
/**
* @inheritdoc
*/
public function getRouteName()
{
// This assume to return the entity show page route
return 'yourproject_yourentity_show';
}
/**
* @inheritdoc
*/
public function getSeoTitleDefaultValue()
{
return $this->title;
}