简体   繁体   English

刀片视图未在Laravel中呈现

[英]Blade view not rendering in laravel

I am developing a website where candidate entry has to be done and record search. 我正在开发一个网站,必须进行候选人输入并记录搜索。

I have created a single Blade view file. 我已经创建了一个刀片视图文件。 In which there are different section which are called based on the if condition. 其中有不同的部分,这些部分基于if条件被调用。

My Display.blade.php view is as below 我的Display.blade.php视图如下

<center>
    @if($ID>0)
        <table border="0" width="100%">
            <tr>
                <td>@include('Header')</td>
            </tr>
            <tr>
                <td style="font-family:arial;font-size:30px;text-align:center;">Edit Registration</td>
            </tr>
        </table>
    @endif

<!--First Call-->
@if($ID < 0)
    <table border="0" width="100%">
        <tr>
            <td>@include('Header')</td>
        </tr>
        <tr>
            <td style="font-family:arial;font-size:30px;text-align:center;">New Registration1</td>
        </tr>
    </table>
    <form action="/Register" method="post" target="_self">
    <input type = "hidden" name = "_token" value = "<?php echo csrf_token() ?>">    
        <table border="1" width="70%" cellpadding="3" style="border-collapse: collapse" bordercolor="#eeeeee">
            <tr>
                <td>First Name</br><input type="text" name="fname" /></td>

                <td>Middle Name</br><input type="text" name="mname" /></td>

                <td>Last Name</br><input type="text" name="lname" /></td>
                <td>Contact No</br><input type="text" name="contactno" /></td>
            </tr>
            <tr>
                <td colspan="4" align="center"><input type="submit" value="Submit"></td>
            </tr>
        </table>
    </form>
@endif
</center>

Header.blade.php is as below. Header.blade.php如下。

    <style>
        .container 
        {
             background-image: url("header.jpg");
              background-repeat: repeat-all;
             left:0;
             top:0;
             width:100%;
             height:80px;
        }
 </style>

        <div class="container">
            <div class="Cname">Cube Placement</div>
            <div class="rTable">
                <div class="rTableRow">
                    <div class="rTableHead">
             <strong>
              <a href='{!!url('/Register'); !!}'>Register</a>
             </strong></div>
                    <div class="rTableHead"><strong>Report</strong></div>
                </div>
            </div>
        </div>

the code execute fine. 代码执行得很好。 When Edit Registration section is executed CSS is missing from the page but when New Registration section is called CSS works fine. 执行“编辑注册”部分时,页面上缺少CSS,但是调用“新注册”部分时,CSS可以正常工作。 except that everything is working correctly. 除了一切工作正常之外。

What is wrong in my code. 我的代码有什么问题。

To make your css accessible on every page, place the css file in a folder in the public folder and use this code in the link tag where you call the css file, preferably in the file you load on every page. 为了使css在每个页面上都可访问,请将css文件放在公用文件夹中的文件夹中,并在调用css文件的链接标记中(最好是在每个页面上加载的文件中)使用此代码。

{{ URL::to('/') }}/path/style.css

Here you say to the browser go to yourdomain.com/path/style.css 在这里,您对浏览器说转到yourdomain.com/path/style.css

Hope it works for you 希望这对你有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM