承接 manuelodelain/linkify-twig-extension 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

manuelodelain/linkify-twig-extension

最新稳定版本:2.0

Composer 安装命令:

composer require manuelodelain/linkify-twig-extension

包简介

Twig extension for Linkify - converts URLs and email addresses into HTML links

README 文档

README

Use Linkify in your twig template.

Installation

Using Composer: composer require manuelodelain/linkify-twig-extension

Usage

use manuelodelain\Twig\Extension\LinkifyExtension; use Twig\Environment; $twig = new Environment(...); $twig->addExtension(new LinkifyExtension()); 
{{ 'Lorem ipsum ... www.website.com ...'|linkify }} 

Will output:

Lorem ipsum ... <a href="www.website.com">www.website.com</a> ... 

Don't forget to apply the raw filter for an HTML output:

{{ 'Lorem ipsum ... www.website.com ...'|linkify|raw }} 

Options

As Linkify, set default options at the instanciation or at the method call.

At the instanciation (applied to all links):

use manuelodelain\Twig\Extension\LinkifyExtension; $twig = new Environment(...); $twig->addExtension(new LinkifyExtension(array('attr' => array('target' => '_blank')))); 

At the method call:

{{ 'Lorem ipsum ... www.website.com ...'|linkify({"attr": {"target": "_blank"}}) }} 

Will output:

Lorem ipsum ... <a href="www.website.com" target="_blank">www.website.com</a> ... 

See the Linkify options

统计信息

  • 总下载量: 70.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固