1. Go to this page and download the library: Download akh/typograf 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/ */
$t = new \Akh\Typograf\Typograf();
// Включить правило
$t->enableRule('Nbsp\ReplaceNbsp');
// Включить все правила в группе
$t->enableRule('Nbsp\*');
// Включить все правила
$t->enableRule('*');
// Отключить правило
$t->disableRule('Nbsp\ReplaceNbsp');
// Отключить все правила в группе
$t->disableRule('Nbsp\*');
// Отключить все правила
$t->disableRule('*');
$typo = new \Akh\Typograf\Typograf();
$simpleRule = new class extends \Akh\Typograf\Rule\AbstractRule {
public $name = 'Замена названия сайта';
protected $sort = 1000;
public function handler(string $text): string
{
return str_replace('old.ru', 'new.ru', $text);
}
};
$typo->addRule($simpleRule);
$typo->apply('old.ru'); //new.ru
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.