Laravel - Method link_to_route does not exist

北慕城南 提交于 2019-12-06 12:45:01

Fixed it, it seems that the documentation is really out-dated, or that laravel 4.0 is just really new ;)

replaced "link_to_route" with "linkRoute". Found it by looking into the vendor files.

Just FYI, or next searcher

For the latest Release (4.1) the text will be encoded itself. to get the link you have to specify the link manually like this

 <a href="{{ URL::route('homepage') }}"><i class="fa fa-pencil "></i></a>

It's must easier to use linkRoute.

Example: {{ HTML::linkRoute('name-of-route', 'Go to my route') }}

If you wanted to use the old way http://laravelcollective.com/docs/5.0/html

However this seems to be the new way

string linkRoute(string $name, string $title = null, array $parameters = array(), array $attributes = array())

http://laravel.com/api/5.0/Illuminate/Html/HtmlBuilder.html#method_link

See usage http://laravel-recipes.com/recipes/190/generating-a-html-link-to-a-named-route

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!