
Преобразование неактивных ссылок в тексте
skeeks/yii2-link-activation
Небольшое расширение для преобразования неактивных ссылок в тексте в активные (кликабельные). Может преобразовывать html или текст, возможно преобразовывать на клиенте (js) а так же на бэкенде (php).
-
Семенов Александр
- /
- Autre
- /
- il y a 4 ans
- /
- /
- 14951
- /
- 0
Heure de publication: dimanche 7 avril 2019 (il y a 4 ans)
Créé par: Семенов Александр Сергеевич
Catégorie: Autre
Version actuelle:
1 janv. 1970 à 03:00:00 (il y a 53 ans)
Packagist: skeeks/yii2-link-activation
: https://github.com/skeeks-semenov/yii2-link-activation
:
Type: Компонент
Небольшое расширение для преобразования неактивных ссылок в тексте в активные (кликабельные). Может преобразовывать html или текст, возможно преобразовывать на клиенте (js) а так же на бэкенде (php).
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
-
Семенов Александр
- /
- 7 avr. 2019
- /
- Aux développeurs / programmeurs
- /
- 0
- /
- 13805
Comment convertir des liens inactifs dans le texte en actifs (cliquables)?
La conversion de liens en texte brut ou HTML est une tâche très fréquente visant à fournir à vos utilisateurs des fonctionnalités de site pratiques de haute qualité et pratiques. Après tout, lorsque vous donnez à vos utilisateurs quelque chose à écrire indépendamment sur le site (par exemple, des commentaires), vous essayez bien sûr de les protéger du code HTML. Mais s'ils ne l'utilisent pas, ils ne peuvent pas sélectionner de liens selon les règles html. Et cela doit être fait pour eux.
Pour les projets sur le framework yii2, j'ai écrit une petite extension: https://cms.skeeks.com/marketplace/components/tools/other/396-preobrazovanie-neaktivnyh-ssylok-v-tekste
CHANGELOG
0.0.3
- Can be used
0.0.2
- -
0.0.1
- -
dev-master — 1 janv. 1970 à 03:00:00 (il y a 53 ans)
1.0.0 — 1 janv. 1970 à 03:00:00 (il y a 53 ans)
0.0.3 — 1 janv. 1970 à 03:00:00 (il y a 53 ans)
0.0.2 — 1 janv. 1970 à 03:00:00 (il y a 53 ans)
0.0.1 — 1 janv. 1970 à 03:00:00 (il y a 53 ans)
Стандартная установка:
Добавьте composer.json файл вашего проекта:
"skeeks/yii2-link-activation": "*"
Запустите обновление зависимостей
Tous les commentaires (0)