ErrorException(E_ERROR)使用未定义的常量yonetim-假定为“ yonetim”(这将在以后的PHP版本中引发错误)

时间:2019-06-11 18:00:38

标签: php laravel-5

ErrorException(E_ERROR) 使用未定义的常量yonetim-假定为“ yonetim”(这将在以后的PHP版本中引发错误)(查看:/srv/http/blog/resources/views/admin/template.blade.php)(查看:/ srv /http/blog/resources/views/admin/template.blade.php) 以前的例外情况

  

使用未定义的常量yonetim-假定为“ yonetim”(这将在以后的PHP版本中引发错误)(查看:/srv/http/blog/resources/views/admin/template.blade.php)(0 )   使用未定义的常量yonetim-假定为“ yonetim”(这将在以后的PHP版本中引发错误)(0)

php

<ul>
    <li class="active"><a href="{{ route(yonetim.index) }}"><i class="icon icon-home"></i> <span>Dashboard</span></a> </li>
    <li class=""><a href="{{ route(ayarlar.index) }}"><i class="icon icon-home"></i> <span>Ayarlar</span></a> </li>

2 个答案:

答案 0 :(得分:1)

在缺少引号的情况下,将<li>替换为

<li class="active"><a href="{{ route('yonetim.index') }}"><i class="icon icon-home"></i> <span>Dashboard</span></a> </li>
<li class=""><a href="{{ route('ayarlar.index') }}"><i class="icon icon-home"></i> <span>Ayarlar</span></a> </li>

也可以尝试:

以下路线的示例:Route::get('/home/index', 'HomeController@index');

<li class="active"><a href="{{ '/home/index' }}"><i class="icon icon-home"></i> <span>Dashboard</span></a> </li>

答案 1 :(得分:-1)

仅以此替换您的代码,

<ul>
    <li class="active"><a href="{{ 'route(yonetim.index)' }}"><i class="icon icon-home"></i> <span>Dashboard</span></a> </li>
    <li class=""><a href="{{ 'route(ayarlar.index)' }}"><i class="icon icon-home"></i> <span>Ayarlar</span></a> </li>