Laravel 4 - Blade Templating - How to properly Link to Route?(Laravel 4 - 刀片模板 - 如何正确链接到路线?)
问题描述
我想用 Laravel 创建一个资源丰富的链接.通常我只使用 {{ link_to_route('Yadayadayada.route', 'LinkName', $params }}
I want to create a resourceful link with Laravel.
Normally I just use the {{ link_to_route('Yadayadayada.route', 'LinkName', $params }}
但在这种情况下,我使用的是具有这种布局的模板:
But in this case I am using a Template with this layout:
<a href="index.html">
<i class="icon-dashboard"></i>
<span class="menu-text"> Dashboard </span>
</a>
这意味着在锚标记内部,还有一个 <i>
-Tag 和一个 <span>
-Tag.是否可以使用 {{ link_to_route }}
-Method,而无需更改模板的布局?
That means that inside the anchor tag, is as well a <i>
-Tag and a <span>
-Tag.
Is it possible to use the {{ link_to_route }}
-Method, without having to change the layout of the Template?
推荐答案
使用 URL::route()
只获取一个链接:
Use URL::route()
to get just a link:
<a href="{{ URL::route('user/profile/', $params) }}">
<i class="icon-dashboard"></i>
<span class="menu-text"> Dashboard </span>
</a>
这篇关于Laravel 4 - 刀片模板 - 如何正确链接到路线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Laravel 4 - 刀片模板 - 如何正确链接到路线?


基础教程推荐
- php 7.4 在写入变量中的 Twig 问题 2022-01-01
- Web 服务器如何处理请求? 2021-01-01
- 将变量从树枝传递给 js 2022-01-01
- php中的PDF导出 2022-01-01
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- php中的foreach复选框POST 2021-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01