国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

[已解決]多語言報(bào)錯TypeError

EchoNoch

問題已解決

是手冊中

#所有的語言文件都是返回一個數(shù)組例如:
// resource/translations/en/messages.php

return [
    'hello' => 'Hello webman',
];

需要加入<?php
改為

// resource/translations/en/messages.php
<?php
return [
    'hello' => 'Hello webman',
];

問題描述

模板中使用多語言時(shí)報(bào)錯

TypeError: Symfony\Component\Translation\Loader\PhpFileLoader::loadResource(): Return value must be of type array, int returned in /vendor/symfony/translation/Loader/PhpFileLoader.php:33

程序代碼

trans('login');

報(bào)錯信息

TypeError: Symfony\Component\Translation\Loader\PhpFileLoader::loadResource(): Return value must be of type array, int returned in /vendor/symfony/translation/Loader/PhpFileLoader.php:33

截圖報(bào)錯信息里報(bào)錯文件相關(guān)代碼

#報(bào)錯文件,錯誤發(fā)生在此處的18行 return require $resource;

namespace Symfony\Component\Translation\Loader;
class PhpFileLoader extends FileLoader
{
    private static ?array $cache = [];

    /**
     * {@inheritdoc}
     */
    protected function loadResource(string $resource): array
    {
        if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) {
            self::$cache = null;
        }

        if (null === self::$cache) {
            return require $resource;
        }

        if (isset(self::$cache[$resource])) {
            return self::$cache[$resource];
        }

        return self::$cache[$resource] = require $resource;
    }
}

操作系統(tǒng)及workerman/webman等框架組件具體版本

最新版本webman
環(huán)境為php80 opcache已開啟 原生模板
語言包已建立且無誤

1262 0 0
0個回答

年代過于久遠(yuǎn),無法發(fā)表回答
??