LoginSignup
1
0

More than 3 years have passed since last update.

【Laravel】HTML::linkやHTML::linkActionメソッドが使えない件(LaravelCollective)

Last updated at Posted at 2020-02-14

環境

  • PHP 7.4.1
  • Composer 1.9.3
  • Laravel Framework 6.14.0
  • laravelcollective/html v6.0.3

結論

LaravelCollective/html v5.4から記法が変更になっています。
v5.4以降を使用する場合は、link_toやlink_to_actionメソッドを使いましょう。
https://laravelcollective.com/docs/6.0/html#generating-urls


// v5.3以前
Html::link('foo/bar', $title = null, $attributes = [], $secure = null)
Html::linkAction('HomeController@getIndex', $title = null, $parameters = [], $attributes = [])

// v5.4以降
link_to('foo/bar', $title = null, $attributes = [], $secure = null)
link_to_action('HomeController@getIndex', $title = null, $parameters = [], $attributes = [])

参考(公式)

・LaravelCollective | HTML v5.3
https://laravelcollective.com/docs/5.3/html#generating-urls

・LaravelCollective | HTML v5.4
https://laravelcollective.com/docs/5.4/html#generating-urls

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0