drupal8 url link
来源:互联网 发布:快递单号记录软件 编辑:程序博客网 时间:2024/06/10 03:48
- // Internal path (defined by a route in Drupal 8).
- use Drupal\Core\Url;
- $url= Url::fromRoute('book.admin');
- $internal_link= \Drupal::l(t('Book admin'),$url);
- // External Uri.
- use Drupal\Core\Url;
- $url= Url::fromUri('http://www.example.com/');
- $external_link= \Drupal::l(t('External link'),$url);
- ==================================or==================================================
- use Drupal\Core\Url;
- use Drupal\Core\Link;
- $url= Url::fromRoute('entity.node.edit_form',array('node'=> NID));
- $project_link= Link::fromTextAndUrl(t('Open Project'),$url);
- $project_link= $project_link->toRenderable();
- // If you need some attributes.
- $project_link['#attributes']= array('class'=> array('button','button-action','button--primary','button--small'));
- print render($project_link);
https://chromatichq.com/blog/creating-links-within-twig-templates-using-path-and-url
// Link to the default frontpage content listing view:<a href="{{ path('view.frontpage') }}">{{ 'View all content'|t }}</a>// Link to a specific node page:<a href="{{ path('entity.node.canonical', {'node': node.id}) }}">{{ 'Read more'|t }}</a>// Link to a specific user profile page:<a href="{{ path('entity.user.canonical', {'user': user.id}) }}">{{ 'View user profile'|t }}</a>// Link to a view, and throw in some additional query string parameters:<a href="{{ path('view.articles.page_1', {'page': 2}) }}">{{ 'Go to page 2'|t }}</a>// Link to a view and pass in some arguments to the view:<a href="{{ path('view.recent_articles_by_author.page_1', {'arg_0': user.field_display_name.value|drupal_escape }) }}">{{ 'See all the articles written by'|t }} {{ user.field_display_name.value }}</a>
0 0
- drupal8 url link
- link与@import url()
- Build URL link by GUID
- Java解析百度link?url
- drupal8 常用
- drupal8 '#theme'
- drupal8 入门
- Dompdf for PHP & Replace Url to link
- Sharekit - sending a url link to facebook
- Android-Link-Preview android url预览
- Drupal8 调试Twig模板
- drupal8执行流程图
- drupal8 form api
- Drupal8 PHPExcel_Shared_Date not found
- Drupal8 资料搜集
- drupal8 模块设置
- Delphi实现解析百度搜索结果link?url=
- http://wenku.baidu.com/link?url=ya12hH4fhnV7SdqxsB1AOLV2pM_qkbjCzEPe5gMSimPNonWmGJN0L4W5cNMu69wcszVF
- leetcode_169. Majority Element
- leetcode#121#122#123 Best Time to Buy and Sell Stock
- Mysql5.7安装初始化
- Linux基本分区管理
- Android 6.0.1选取本地图片操作时报No Activity found to handle intent错误
- drupal8 url link
- Nginx的安装
- HTTP相关知识点总结
- Final Cut Pro X 学习笔记
- 将日志保存到文件中
- Dojo1.11官方教程文档翻译(6.1)Dojo Object Store
- 自定义通讯协议
- 虚拟ip +keeplalived+nginx 负载实现
- Leetcode-43.Multiply Strings