Conversion of inactive links in the text ΒΆ
A small extension to convert active links in the text to active (clickable). It can convert html or text, it is possible to convert on the client (js) as well as on the backend (php).
ΠΠ΅Π±ΠΎΠ»ΡΡΠΎΠ΅ ΡΠ°ΡΡΠΈΡΠ΅Π½ΠΈΠ΅ Π΄Π»Ρ ΠΏΡΠ΅ΠΎΠ±ΡΠ°Π·ΠΎΠ²Π°Π½ΠΈΡ Π½Π΅Π°ΠΊΡΠΈΠ²Π½ΡΡ ΡΡΡΠ»ΠΎΠΊ Π² ΡΠ΅ΠΊΡΡΠ΅ Π² Π°ΠΊΡΠΈΠ²Π½ΡΠ΅ (ΠΊΠ»ΠΈΠΊΠ°Π±Π΅Π»ΡΠ½ΡΠ΅). ΠΠΎΠΆΠ΅Ρ ΠΏΡΠ΅ΠΎΠ±ΡΠ°Π·ΠΎΠ²ΡΠ²Π°ΡΡ html ΠΈΠ»ΠΈ ΡΠ΅ΠΊΡΡ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ ΠΏΡΠ΅ΠΎΠ±ΡΠ°Π·ΠΎΠ²ΡΠ²Π°ΡΡ Π½Π° ΠΊΠ»ΠΈΠ΅Π½ΡΠ΅ (js) Π° ΡΠ°ΠΊ ΠΆΠ΅ Π½Π° Π±ΡΠΊΠ΅Π½Π΄Π΅ (php).
Installation ΒΆ
$ composer require skeeks/yii2-link-activation "^0.0.3"
Or add this to your composer.json file:
{
"require": {
"skeeks/yii2-link-activation": "^0.0.3"
}
}
Client replace (on js) ΒΆ
<?
\skeeks\yii2\linkActivation\assets\TextHandlerAsset::register($this);
$this->registerJs(<<<JS
new sx.classes.LinkActivation(".description");
JS
);
?>
<div class="description">
ΠΠ°ΠΊΠΎΠΉ ΡΠΎ ΡΠ΅ΠΊΡΡ ΡΠΎ ΡΡΡΠ»ΠΊΠ°ΠΌΠΈ https://test.ru,
https://google.ru/search
ΠΡΠ΅ ΡΡΡΠ»ΠΊΠΈ Π±ΡΠ΄ΡΡ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ https://cms.skeeks.com/blog/releases/2-zapusk-sayta-dlya-skeeks-cms ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Ρ Π² ΡΡΠΎΠΌ ΡΠ΅ΠΊΡΡΠ΅ ΠΈ ΡΡΠ°Π½ΡΡ ΠΊΠ»ΠΈΠΊΠ°Π±Π΅Π»ΡΠ½ΡΠΌΠΈ
</div>
Backend replace ΒΆ
<?
$handler = new \skeeks\yii2\linkActivation\TextHandler();
$handler->short_link_max_length = 45;
echo $handler->replace($yourText);
?>
<?= (new \skeeks\yii2\linkActivation\TextHandler())->replace($yourText); ?>
Screenshot ΒΆ
Video ΒΆ
Links ΒΆ
SkeekS CMS (Yii2) β quickly, easily and effectively!
skeeks.com | cms.skeeks.com






If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.