Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

laravel5.4で定数を定義してbladeで表示する

定数を定義

  • /config/const.phpに定義
const.php
return array(
    'constOne'=> '定数一',
    'constTwo'=> '定数二',
);

bladeで表示

  • {{Config::get('const.constOne')}}で表示
sample.blade.php
<p>{{Config::get('const.constOne')}}</p>
<p>{{Config::get('const.constTwo')}}</p>

これで、一つ目のpタグには「定数一」、二つ目のpタグには「定数二」と表示されます。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
2
Help us understand the problem. What are the problem?