【发布时间】:2022-01-21 04:35:30
【问题描述】:
当我运行这段代码时,我遇到了这个错误:Symfony\Component\Debug\Exception\FatalThrowableError : syntax error, unexpected end of file
point) 在 NGIX 中我没有任何问题,但现在我想在 laravelhomestead 中运行它,但它抛出了这个错误。
point2)这是路由器中的 content.php 文件
<?php
函数 extView($route) { $texts = [https://www.i-b.com/];
$mercati = ['banking-finance-fintech', 'insurance-insurtech', 'consumer-goods', 'industrial-goods', 'energy-utilities-infrastructure', 'luxury-fashion-design', 'sport-media-entertainment', 'pharma-medicine-healthcare', 'technology-telecom', 'public-sector', 'social-sector', 'private-equity'];
$servizi = ['strategy-governance', 'competitive-intelligence', 'innovation-management', 'ai-bigdata', 'marketing', 'sponsorship', 'sales', 'brand-communication', 'hr-organization', 'sustainability', 'ma'];
if (array_key_exists($route, $texts)) {
return view('general-list', {$texts[$route]});
} else if (in_array($route, $mercati)) {
return view('general-list', {$texts['banking-finance-fintech']});
} else if (in_array($route, $servizi)) {
return view('general-list', {$texts['sponsorship']});
} else {
abort(404);
}
}
【问题讨论】:
-
你运行的代码是什么?
-
我编辑并添加代码
-
能否也添加完整的错误堆栈跟踪?
-
另外,
endif在 PHP 中不是一个东西 -
这就是重点。 PHP 认为他在对“endif”常量做他应该做的事情之前关闭了函数的括号