maxodrom/yii2-seo

Yii2 SEO 组件

1.1.2 2018-06-06 19:47 UTC

This package is not auto-updated.

Last update: 2024-09-25 01:40:36 UTC


README

Yii2 SEO 组件是一个包含一些有用类的包,这些类提供了常用方法来处理和加工 SEO 文本。

SEO image

俄语文档

SeoText 类

提供有用的方法来处理源文本并收集关于处理文本的统计信息。

use maxodrom\yii2seo\components\SeoText;

// instantiate new SeoText object
$seoText = new SeoText($model->textField);

// get total words in our text
$totalWords =  $seoText->getWordsCount();

// get total characters count (including different spaces chars)
$totalCharacters = $seoText->getTotalCharactersCount();

// get only word's characters count
$wordCharacters = $seoText->getCharactersCount();

// get all spaces count 
$totalSpaces = $seoText->getSpacesCount();