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 - 刀片模板 - 如何正确链接到路线?
基础教程推荐
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何替换eregi() 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
