LoginSignup
0
0
記事投稿キャンペーン 「PHP強化月間」

Blade Component はキャメルケースで書く

Posted at

最近 Blade Component を使ってます。
PSR-12 とかだと

  • スネークケースで変数は書こうね
  • 関数名はローワーキャメルケースで書こうね

って感じなので、そんな感じでやってたら若干ハマりました。

NG

<x-layout test_message="なんかのテストメッセージ" />

OK

<x-layout testMessage="なんかのテストメッセージ" />

PSR-12: 4.7 Method and Function Calls をよく見ると、引数はキャメルケースみたいです。(むずすぎいい!!)

まとめ

内容 書き方
変数 スネークケース test_val
関数 ローワーキャメルケース testMethod
引数 ローワーキャメルケース testArg
0
0
1

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
0
0