解析错误:语法错误,文件意外结束,第 25 行在module\Album\Module.php 中需要函数(T_FUNCTION)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13539834/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 05:38:54  来源:igfitidea点击:

Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) inmodule\Album\Module.php on line 25

phpzend-frameworkframeworks

提问by arjay0601

Hi Guys I am having error on my module.php. I got the code here http://framework.zend.com/manual/2.0/en/user-guide/modules.htmlI am following the instructions but I don't know where I get it wrong. I hope you can help me with this. :) Please see my code below.

大家好,我的module.php 出错了。我在这里得到了代码http://framework.zend.com/manual/2.0/en/user-guide/modules.html我正在按照说明进行操作,但我不知道哪里出错了。我希望你能帮我解决这个问题。:) 请看下面我的代码。

    <?php
namespace Album;

class Module
{
    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\ClassMapAutoloader' => array(
                __DIR__ . '/autoload_classmap.php',
            ),
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }

    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }

回答by Marcin Orlowski

Your code lacks closing bracket at the end. Add }at the end of your script, to close classblock

您的代码末尾缺少右括号。}在脚本末尾添加,以关闭class