1. Go to this page and download the library: Download yepteam/typograph 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/ */
yepteam / typograph example snippets
use Yepteam\Typograph\Typograph;
// Инициализация со стандартными параметрами
$typograph = new Typograph();
$html = $typograph->format($html);
new Typograph(true); // готовыми символами (raw)
new Typograph(false); // буквенными кодами (named)
$typograph->format($html);
$metrics = $typograph->getMetrics();
// [
// 'originalContentLength' => 1234, // длина исходного текста (символов)
// 'resultContentLength' => 1256, // длина результата (символов)
// 'tokenizationTime' => 0.001, // время токенизации (сек)
// 'processingTime' => 0.004, // время применения правил (сек)
// 'totalTime' => 0.005, // суммарное время (сек)
// 'memoryUsage' => 524288 // использование памяти (байт)
// ]
// Изменить параметры у существующего экземпляра
$typograph->setOptions(['entities' => Typograph::ENTITIES_NAMED]);
// Получить текущие параметры и параметры по умолчанию
$typograph->getOptions();
$typograph->getDefaultOptions();
// Получить массив токенов после обработки (удобно вместе с 'debug' => true)
$typograph->getTokens();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.