dev-master
9999999-devHandy module for managing seo attributes
MIT
The Requires
by Jasur Mirkhamidov
extension yii2 seo
Wallogit.com
2017 © Pedro Peláez
Handy module for managing seo attributes
The preferred way to install this extension is through composer., (*1)
Either run, (*2)
composer require mirkhamidov/yii2-seo "@dev"
or add, (*3)
"mirkhamidov/yii2-seo": "@dev"
to the require section of your composer.json file., (*4)
for run migrations add to your console config migrationNamespaces, (*5)
<?php
return [
'controllerMap' => [
'migrate' => [
'class' => 'yii\console\controllers\MigrateController',
'migrationNamespaces' => [
'mirkhamidov\seo\migrations',
],
],
],
];
just run, (*6)
./yii migrate
add module to your config, (*7)
return [
...,
'modules' => [
...,
'seo' => 'mirkhamidov\seo\Module',
],
...,
];
Routes to Menu, (*8)
seo/page - to add new config for routeseo/attribute - to add more attributes add bootstap and component to your config, (*9)
return [
'bootstrap' => [
...,
'seo',
],
...,
'components' => [
...,
'seo' => [
'class' => 'mirkhamidov\seo\components\Seo'
],
],
...,
];
<?php
if (is_null(Yii::$app->seo->tag('title'))) {
echo '<title>' . Html::encode($this->title) . ' - ' . Yii::$app->name . '</title>';
} else {
echo '<title>' . Html::encode(Yii::$app->seo->tag('title')) . '</title>';
}
?>
<h1 class="main-title">
<?php
if (is_null(Yii::$app->seo->tag('h1'))) {
echo Html::encode($this->title);
} else {
echo Html::encode(Yii::$app->seo->tag('h1'));
}
?>
</h1>
Handy module for managing seo attributes
MIT
extension yii2 seo