PHP code example of ochen-studio / yii2-typograph
1. Go to this page and download the library: Download ochen-studio/yii2-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/ */
ochen-studio / yii2-typograph example snippets
" "ochen/yii2-typograph": "^1.0.0",
}
composer
return [
'components' => [
...
'typograph' => [
'class' => 'Ochen\Typograph\TypographComponent',
],
]
];
return [
'components' => [
...
'typograph' => [
'class' => 'Ochen\Typograph\TypographComponent',
'additionalRulesPath' => '@common/components/typograph/config/additionalRules.php',
'changedRulesPath' => '@common/components/typograph/config/changedRules.php',
],
]
];
$typographComponent->process('до н. э.');
public function behaviors()
{
return [
[
'class' => TypographBehaviour::class,
'attributes' => ['title']
],
];
}
public function behaviors()
{
return [
[
'class' => TypographerBehaviour::class,
'attributes' => [
'items' => [
'properties' => ['title', 'description']
]
]
],
];
}
\Yii::$container->setSingleton('Ochen\PhpTypograph\TypografInterface', function() use ($app) {
return $app->get('typograph');
});