Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
注意:错误:无法加载语言模块/magnorcms!第39行的//system/library/language.php中_Php_Opencart - Fatal编程技术网

注意:错误:无法加载语言模块/magnorcms!第39行的//system/library/language.php中

注意:错误:无法加载语言模块/magnorcms!第39行的//system/library/language.php中,php,opencart,Php,Opencart,我已经安装了一个opencart主题,您可以在这里观看: taswikdz.com 但我在标题中有一个错误 注意:错误:无法加载语言模块/magnorcms!第39行的//system/library/language.php中 文件如下: 模块/magnorcms.php <?php class ControllerModulemagnorcms extends Controller { protected function index($setting) {

我已经安装了一个opencart主题,您可以在这里观看:

taswikdz.com

但我在标题中有一个错误

注意:错误:无法加载语言模块/magnorcms!第39行的//system/library/language.php中

文件如下:

模块/magnorcms.php

<?php  
class ControllerModulemagnorcms extends Controller {
    protected function index($setting) {
        $this->language->load('module/magnorcms');

        $this->data['heading_title'] = sprintf($this->language->get('heading_title'), $this->config->get('config_name'));

        $get_lan_id = $this->config->get('config_language_id');


        $this->data['magnorcms_header'] = html_entity_decode(isset($setting['headertitle'][$get_lan_id]) ? $setting['headertitle'][$get_lan_id] : '' , ENT_QUOTES, 'UTF-8');

        $this->data['message'] = html_entity_decode(isset($setting['description'][$get_lan_id]) ? $setting['description'][$get_lan_id] : '' , ENT_QUOTES, 'UTF-8');


        if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/magnorcms.tpl')) {
            $this->template = $this->config->get('config_template') . '/template/module/magnorcms.tpl';
        } else {
            $this->template = 'default/template/module/magnorcms.tpl';
        }

        $this->render();
    }
}
?>

library/language.php

<?php
class Language {
private $default = 'english';
private $directory;
private $data = array();

public function __construct($directory) {
    $this->directory = $directory;
}

public function get($key) {
    return (isset($this->data[$key]) ? $this->data[$key] : $key);
}

public function load($filename) {
    $file = DIR_LANGUAGE . $this->directory . '/' . $filename . '.php';

    if (file_exists($file)) {
        $_ = array();

        require($file);

        $this->data = array_merge($this->data, $_);

        return $this->data;
    }

    $file = DIR_LANGUAGE . $this->default . '/' . $filename . '.php';

    if (file_exists($file)) {
        $_ = array();

        require($file);

        $this->data = array_merge($this->data, $_);

        return $this->data;
    } else {
        trigger_error('Error: Could not load language ' . $filename . '!');
    //  exit();
    }
}
}
?>

在这里,您已经在商店中添加了自定义模块。因此,站点源中的it模块缺少语言文件。默认OpenCart源代码中的自定义模块语言文件不可用

最可能的原因可能是源中缺少以下文件之一:

catalog/language/your-language-folder/module/magnorcms.php

您需要添加
magnorcms.php
文件。然后再试。

您有一个缺少的语言文件,需要添加到/catalog/language/your language folder/module中。该文件是magnorcms.php.woow谢谢您是最好的。OK,将为此编写一个答案,以便您可以接受。