如何IntlDateFormatter
在 Symfony 4.4 中实现。
参考https://symfony.com/doc/current/components/intl.html我已经安装了symfony/intl
现在当我在我的代码中使用它时:
use Symfony\Component\Intl\DateFormatter\IntlDateFormatter;
$formatter = new IntlDateFormatter(
"de-DE",
IntlDateFormatter::FULL,
IntlDateFormatter::NONE,
"Europe/Berlin",
IntlDateFormatter::GREGORIAN,
"MMMM YYYY"
);
我越来越Cannot instantiate abstract class Symfony\Component\Intl\DateFormatter\IntlDateFormatter
。我知道抽象类不能被实例化。但我不确定如何实施。