解析错误语法错误,意外T_ELSE

时间:2014-11-06 15:43:01

标签: php

我似乎无法弄清楚为什么我一直在第17行收到此错误。调用堆栈说 Location : 27,即路由功能和Location : 0,即{main}( )

<?php
define("true-access", true);
session_start();
ob_start();
function get_option_enabled($option) {
    if ($option == "store") {
        return "store/controller.php";
    } else {
        return false;
    }
}

function route() {
    $option = empty($_GET["option"]) ? "store" : $_GET["option"];
    $view = empty($_GET["view"]) ? "list" : $_GET["view"];

    //get files to include from database
    if ($controller = get_option_enabled($option)) {

        include_once('components/' . $controller);
        controller_route($view);
    } else {
        echo "404";
    }
}

route();

ob_end_flush();
?>

0 个答案:

没有答案