gpt4 book ai didi

php - Laravel:如何显示配置?

转载 作者:行者123 更新时间:2023-11-28 15:44:23 26 4
gpt4 key购买 nike

我最近更改了我的页面以使用扩展标题,因为每个页面上的标题内容都相同,所以这似乎是个好主意。完成此操作后,我的页脚完全停止工作,以及它的配置部分。当我现在尝试从 Laravel 获取配置时,它只是显示为正常内容,您可以在下面看到:

页脚的显示方式:

{{ Config::get('frontend.site_name') }} 2017 / Powered by the amazing {{ config('frontend.powered_by') }}.
Copyright © 2017 {{ Config::get('frontend.website_author') }}, and others who have supported this project. All rights reserved.

标题(它扩展的 View ):

<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
<title>{{ config('frontend.site_name') }} - @yield('title')</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="{{ config('frontend.assets_path') }}/css/override.css" rel="stylesheet" type="text/css">
</head>
<body id="home">
<div class="container">
<br>
@yield('body')
</div>
@include('frontend.footer')
</body>
</html>

实景:

@extends('frontend.header')
@section('title')
Home
@endsection
@section('body')
Write something here soon
@endsection

前端.页脚:

    <div class="container">
<div class="col-md-12" style="margin-bottom:2%;">
{{ Config::get('frontend.site_name') }} <?php echo date("Y"); ?> / Powered by the amazing {{ config('frontend.powered_by') }}.<br>
Copyright © 2017 {{ Config::get('frontend.website_author') }}, and others who have supported this project. All rights reserved.
</div>
</div>
<script src="https://use.fontawesome.com/905fc4df74.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>
</html>

最佳答案

确保文件名有.blade部分:

resources/views/frontend/footer.blade.php

关于php - Laravel:如何显示配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43056036/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com