抛出消息" hmmlspecialchars()的ErrorException期望参数1为字符串,给定Stacktrace的对象:#59

时间:2018-01-06 09:42:25

标签: laravel model-view-controller indexing frameworks

抛出错误消息" htmlspecialchars()期望参数1为字符串,给定对象(查看:G:\ xampp \ htdocs \ Blog \ resources \ views \ songs \ index.blade.php)&#34 ;

堆栈跟踪:

#59 ErrorException in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Support\helpers.php:577
#58 ErrorException in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Support\helpers.php:577
#57 htmlspecialchars in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Support\helpers.php:577
#56 e in G:\xampp\htdocs\Blog\storage\framework\views\22d7e70a74a9a552984fc94db5531053afea2405.php:4
#55 include in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php:43
#54 Illuminate\View\Engines\PhpEngine:evaluatePath in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php:59
#53 Illuminate\View\Engines\CompilerEngine:get in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\View\View.php:137
#52 Illuminate\View\View:getContents in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\View\View.php:120
#51 Illuminate\View\View:renderContents in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\View\View.php:85
#50 Illuminate\View\View:render in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Http\Response.php:42
#49 Illuminate\Http\Response:setContent in G:\xampp\htdocs\Blog\vendor\symfony\http-foundation\Response.php:200
#48 Symfony\Component\HttpFoundation\Response:__construct in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Router.php:724
#47 Illuminate\Routing\Router:toResponse in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Router.php:698
#46 Illuminate\Routing\Router:prepareResponse in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Router.php:658
#45 Illuminate\Routing\Router:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:30
#44 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Middleware\SubstituteBindings.php:41
#43 Illuminate\Routing\Middleware\SubstituteBindings:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#42 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#41 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken.php:67
#40 Illuminate\Foundation\Http\Middleware\VerifyCsrfToken:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#39 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#38 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php:49
#37 Illuminate\View\Middleware\ShareErrorsFromSession:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#36 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#35 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php:63
#34 Illuminate\Session\Middleware\StartSession:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#33 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#32 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php:37
#31 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#30 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#29 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php:59
#28 Illuminate\Cookie\Middleware\EncryptCookies:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#27 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#26 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:102
#25 Illuminate\Pipeline\Pipeline:then in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Router.php:660
#24 Illuminate\Routing\Router:runRouteWithinStack in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Router.php:635
#23 Illuminate\Routing\Router:runRoute in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Router.php:601
#22 Illuminate\Routing\Router:dispatchToRoute in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Router.php:590
#21 Illuminate\Routing\Router:dispatch in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:176
#20 Illuminate\Foundation\Http\Kernel:Illuminate\Foundation\Http\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:30
#19 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\fideloper\proxy\src\TrustProxies.php:56
#18 Fideloper\Proxy\TrustProxies:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#17 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#16 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php:30
#15 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#14 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#13 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php:30
#12 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#11 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#10 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ValidatePostSize.php:27
#9 Illuminate\Foundation\Http\Middleware\ValidatePostSize:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#8 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#7 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php:46
#6 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode:handle in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
#5 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
#4 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:102
#3 Illuminate\Pipeline\Pipeline:then in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:151
#2 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:116
#1 Illuminate\Foundation\Http\Kernel:handle in G:\xampp\htdocs\Blog\public\index.php:55
#0 require_once in G:\xampp\htdocs\Blog\server.php:21

1 个答案:

答案 0 :(得分:0)

您收到错误是因为您尝试将非字符串变量(对象,数组等)用作index.blade.php中的字符串:

{{ $variable }}