Skip to content

Commit fdde72f

Browse files
Товары 18+
1 parent 69bac3f commit fdde72f

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

src/CmsSeoComponent.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,4 +920,30 @@ protected function _processPriority($content = "")
920920
return $contentNewResult.$content;
921921
}
922922

923+
/**
924+
* @return $this
925+
*/
926+
public function setNoIndexNoFollow()
927+
{
928+
\Yii::$app->view->registerMetaTag([
929+
'name' => 'robots',
930+
'content' => 'noindex, nofollow'
931+
], "robots");
932+
933+
return $this;
934+
}
935+
936+
/**
937+
* @param string $canonicalUrl
938+
* @return $this
939+
*/
940+
public function setCanonical(string $canonicalUrl)
941+
{
942+
\Yii::$app->view->registerLinkTag([
943+
'rel' => 'canonical',
944+
'href' => $canonicalUrl
945+
], "canonical");
946+
947+
return $this;
948+
}
923949
}

0 commit comments

Comments
 (0)