[英]PHP Fatal error: Class Bundle\\Controller\\Symfony\\Component\\Intl\\Intl not found
我需要的
我需要将国家代码转换为货币符号。
like for USD => $.
我需要将货币代码转换为货币符号。
码
控制者
use Symfony\Component\Intl\ResourceBundle\CurrencyBundle;
class EventDetailController extends Controller
{
$currency = $data[0]['currency'];
$Currency= USD
Symfony\Component\Intl\Intl::getCurrencyBundle()->getCurrencySymbol('USD');
}
错误
PHP Fatal error: Class 'Acme\\biztradeshowsBundle\\Controller\\Symfony\\Component\\Intl\\Intl' not found in /home/indiamart/public_html/10into/src/Acme/biztradeshowsBundle/Controller/EventDetailController.php on line 180
您应该编写use
语句:
use Symfony\Component\Intl\ResourceBundle\CurrencyBundle;
use Symfony\Component\Intl\Intl;
class EventDetailController extends Controller
{
$currency = $data[0]['currency'];
$Currency= USD
Intl::getCurrencyBundle()->getCurrencySymbol('USD');
}
或使用斜杠写您的FQCN:
use Symfony\Component\Intl\ResourceBundle\CurrencyBundle;
class EventDetailController extends Controller
{
$currency = $data[0]['currency'];
$Currency= USD
\Symfony\Component\Intl\Intl::getCurrencyBundle()->getCurrencySymbol('USD');
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.