未定义的变量:帖子(查看:C:\ xampp \ htdocs \ blog \ resources \ views \ store \ search.blade.php)

时间:2019-09-02 09:21:58

标签: laravel

因此,我正在尝试实现搜索栏,在我正在工作的博客中,当我搜索它时,它在$Server = (Get-AzureRmAnalysisServicesServer -ResourceGroupName $ResourceGroupName -Name $AASServerName).ServerFullName $ServicePrincipalCredentialSecure = $ServicePrincipalCredential | ConvertTo-SecureString -asPlainText -Force $Cred = New-Object System.Management.Automation.PSCredential($ServicePrincipalId,$ServicePrincipalCredentialSecure) Add-AzureAnalysisServicesAccount -ServicePrincipal -Credential $Cred -RolloutEnvironment "northeurope.asazure.windows.net" -TenantId $TenantId Sync-AzureAnalysisServicesInstance -Instance "$($Server):rw" -Database $Database -Verbose 中给了我未定义的变量帖子,并且我已经尝试了一切。请帮助

这是我的search.blade文件

search.blade.php

还有控制器功能

@extends('layouts.main')    
@section('content')     
    <div class="col-lg-8">     
        @foreach($posts as $post)
            <h2>
                <a href="/store/{{ $post->id }}">{!! $post->title !!}</a>
            </h2>
            <p class="lead">
                by <a href="index.php">{!! $post->author !!}</a>
            </p>
            <p><span class="glyphicon glyphicon-time"></span> Posted on {!! $post->created_at !!}</p>
            <hr>
            <a href="/store/{{ $post->id }}">{!! Html::image('/img/posts/'. $post->image, $post->title, array('style'=>'width: 675px; height:225px;')) !!}</a>{
            <hr>
            <p>{!! $post->short_desc !!}</p>
            <a class="btn btn-primary" href="/store/view/{{ $post->id }}">Read More <span class="glyphicon glyphicon-chevron-right"></span></a>

            <hr>
         @endforeach   
     </div>            
@endsection

0 个答案:

没有答案