Laravel源碼分析:Response

/**
     * Determine(判斷) if the given content should be turned into JSON.
     *
     * @param  mixed  $content
     * @return bool
     */
    protected function shouldBeJson($content)
    {
        return $content instanceof Arrayable ||
               $content instanceof Jsonable ||
               $content instanceof ArrayObject ||
               $content instanceof JsonSerializable ||
               is_array($content);
    }

Arrayable


Jsonable


ArrayObject


JsonSerializable

TODOide

相關文章
相關標籤/搜索