ice / framework

Source code of Ice framework
https://www.iceframework.org
BSD 3-Clause "New" or "Revised" License
341 stars 45 forks source link

Response, add toJson and toXml #218

Closed Yahasana closed 5 years ago

Yahasana commented 5 years ago

add two useful handy helpers to render JSON or XML

function jsonAction() {
    // render to JSON and  stop the framework try to parse layout or view
    return $this->response->toJson([...]);
    // or render to XML
    return $this->response->toXml([...]);
}