diff --git a/packages/core/actions/config/create-model.php b/packages/core/actions/config/create-model.php index d5c89e45b..f3b81b45a 100755 --- a/packages/core/actions/config/create-model.php +++ b/packages/core/actions/config/create-model.php @@ -44,19 +44,20 @@ throw new Exception('missing_classes_dir', QN_ERROR_INVALID_CONFIG); } -$model_path = str_replace("\\","/", $params['model']); +$model_path = $params['model']; -$parts = explode("/", $model_path); +$parts = explode("\\", $model_path); $name = array_pop($parts); + $namespace = implode("\\", $parts); -if(!strlen($name) <= 0){ +if(strlen($name) <= 0){ throw new Exception('empty_model_name', QN_ERROR_INVALID_PARAM); } -if(!ctype_upper(mb_substr($str, 0, 1))){ +if(!ctype_upper(mb_substr($name, 0, 1))){ throw new Exception('broken_naming_convention', QN_ERROR_INVALID_PARAM); }