mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
改进Response类create方法 支持自定义子类的命名空间位置
This commit is contained in:
@@ -68,7 +68,7 @@ class Response
|
|||||||
{
|
{
|
||||||
$type = strtolower($type ?: (IS_AJAX ? 'json' : 'html'));
|
$type = strtolower($type ?: (IS_AJAX ? 'json' : 'html'));
|
||||||
if (!isset(self::$instance[$type])) {
|
if (!isset(self::$instance[$type])) {
|
||||||
$class = '\\think\\response\\' . ucfirst($type);
|
$class = (isset($options['namespace']) ? $options['namespace'] : '\\think\\response\\') . ucfirst($type);
|
||||||
if (class_exists($class)) {
|
if (class_exists($class)) {
|
||||||
$response = new $class($data, $type, $options);
|
$response = new $class($data, $type, $options);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user