1. Go to this page and download the library: Download zmark/seo-plugin 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/ */
zmark / seo-plugin example snippets
public function boot()
{
Event::listen('pages.menuitem.listTypes', function() {
return [
'acme-post' => 'Post page',
];
});
Event::listen('pages.menuitem.getTypeInfo', function($type) {
if ($type == 'acme-post')
return YourModel::getMenuTypeInfo($type);
});
}
public static function getMenuTypeInfo($type)
{
$result = [];
if ($type == 'acme-post') {
$references = [];
$posts = self::get();
foreach ($posts as $post) {
$references[$post->id] = $post->title;
}
$result = [
'references' => $references
];
}
return $result;
}