简体   繁体   中英

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.

My Display.blade.php view is as below

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

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

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

Here you say to the browser go to yourdomain.com/path/style.css

Hope it works for you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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