Еще раз:
по /lottery должна открываться веб-страница.
по /lottery/selectall/ json.
Убедись что бы было так.
Цитата (Guest @ 31.03.2016 - 20:14) |
У тебя наверное еще есть Controller_index да? Который собственно веб-страницу и возвращает? Если да – то Action_index в Controller_lottery не нужна. |
Цитата |
Если да – то Action_index в Controller_lottery не нужна. |
class Router{
public static function Start(){
//Параметры по умолчанию
$controller_name = 'index';
$action_name = 'index';
$action_parameters = array();
$route_array = explode('/', $_SERVER['REQUEST_URI'],3);
if (!empty($route_array[1])) {
$controller_name = $route_array[1];
}
if (!empty($route_array[2])) {
$action_name = $route_array[2];
}
$model_name = 'Model_'.$controller_name;
$controller_name = 'Controller_'.$controller_name;
$action_name = 'Action_'.$action_name;
if(file_exists(F_PATCH.'/system/model/'.$model_name.'.php')){
include F_PATCH.'/system/model/'.$model_name.'.php';
}
if(file_exists(F_PATCH.'/system/controller/'.$controller_name.'.php')){
include F_PATCH.'/system/controller/'.$controller_name.'.php';
}else{
header("Location: /404");
}
$controller = new $controller_name();
$controller->$action_name();
}
}