You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'countersContent' => \Yii::t('skeeks/seo', 'В это поле вы можете поставить любые коды счетчиков и сторонних систем (yandex.metrics jivosite google.metrics и прочие). Они будут выведены внизу страницы, перед закрывающим тегом body'),
174
180
'enableKeywordsGenerator' => \Yii::t('skeeks/seo', 'If the page is not specified keywords, they will generate is for her, according to certain rules automatically'),
175
181
'minKeywordLenth' => \Yii::t('skeeks/seo', 'The minimum length of the keyword, which is listed by the key (automatic generation)'),
176
182
'maxKeywordsLength' => \Yii::t('skeeks/seo', 'The maximum length of the string of keywords (automatic generation)'),
@@ -243,12 +249,26 @@ public function bootstrap($application)
243
249
* Генерация SEO метатегов по контенту страницы
244
250
*/
245
251
$application->view->on(View::EVENT_END_BODY, function (Event$e) {
252
+
253
+
/**
254
+
* @var $view View
255
+
*/
256
+
$view = $e->sender;
257
+
246
258
if ($this->enableKeywordsGenerator && !BackendComponent::getCurrent()) {
247
259
if (!\Yii::$app->request->isAjax && !\Yii::$app->request->isPjax) {
248
-
$this->_generateBeforeOutputPage($e->sender);
260
+
$this->_autoGenerateKeywords($view);
249
261
}
250
262
}
251
263
264
+
if (!BackendComponent::getCurrent()) {
265
+
if ($this->countersContent) {
266
+
$content = ob_get_contents();
267
+
if (strpos($content, $this->countersContent) === false) {
0 commit comments