首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Laravel Blade显示特殊字符

Laravel Blade显示特殊字符
EN

Stack Overflow用户
提问于 2021-11-16 10:51:01
回答 1查看 76关注 0票数 0

我在一个项目中工作,我需要从视图创建PDF。但是在刀片文件中,当我检查我的代码时,没有包含这些字符的标签。有人能帮我解决这个问题吗?我已经添加了刀片文件代码。请看一下。

代码语言:javascript
复制
    <html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
    
</head>

<body>
    @if (count($data['data']) > 0)
        <table class="table table-condensed">
            <tr>
                <td><img src="{{public_path().'/theme/frontend/images/logo.png'}}"alt="kpvlogo"></td>
                <td colspan="8"  style="text-align: center; font-size:24px; font-weight: bold;">Weekly Ranking</td>
                <td colspan="6" >Week Ending {{$data['end']}}</td>
            </tr>
            <tr>
                <thead>
                    <th style="font-weight: bold;">Store</th>
                    <th style="font-weight: bold;">Net Sales</th>
                    <th style="font-weight: bold;">+/- Last Year %</th>
                    <th style="font-weight: bold;">Cust.Count +/- %</th>
                    <th style="font-weight: bold;">Labour %</th>
                    <th style="font-weight: bold;">Food %</th>
                    <th style="font-weight: bold;">Cash %</th>
                    <th style="font-weight: bold;">GSS</th>
                    <th style="font-weight: bold;">Complaints</th>
                    <th style="font-weight: bold;">Speed of Service</th>
                    <th style="font-weight: bold;">Training</th>
                    <th style="font-weight: bold;">Rank</th>
                </thead>
            </tr>
            <tbody>
                @foreach ($data['data']['grid'] as $item)
                    <tr>
                        <td>{{$item['store']}}</td>
                        <td class="text-right">{{$item['net_sales']}}</td>
                        <td class="text-right">{{$item['last_year']}}</td>
                        <td class="text-right">{{$item['customer_count']}}</td>
                        <td class="text-right">{{$item['labour']}}</td>ß
                        <td class="text-right">{{$item['food']}}</td>
                        <td class="text-right">{{$item['cash']}}</td>
                        <td class="text-right">{{$item['gss']}}</td>
                        <td class="text-right">{{$item['complaints']}}</td>
                        <td class="text-right">{{$item['speed_of_service']}}</td>
                        <td class="text-right">{{$item['training']}}</td>
                        <td class="text-right">{{$item['rank']}}</td>
                    </tr>
                @endforeach
                <tr>
                    <td colspan="12" class="text-center">Top Performer of the Week</td>
                </tr>
                <tr>
                    <td colspan="12" class="text-center">Congratulations to the team from <b>{{$data['data']['top']['store']}}</b>  for achieving the overall best results this week.</td>
                </tr>
                <tr>
                    <td colspan="12" class="text-center">Thank You!</td>
                </tr>
            </tbody>
            
        </table>
    @endif
    {{-- <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script>
        var body_text = $('body').text();
        var match = body_text.match('ß');
        console.log(match);
    </script> --}}
    
</body>
</html>
EN

回答 1

Stack Overflow用户

发布于 2021-11-17 02:46:58

如果您能确定刀片文件中特殊字符出现的位置,将会有所帮助。看到在刀片式服务器中找不到任何ß ß ß ß ß ß字符,这表明导致它的原因在您的数据库中的某个地方。我建议您检查$item中显示字符的数据和数据库列,您可能会找到原因。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69987778

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档