Skip to content

Commit

Permalink
Merge 193bc1b into aef32fd
Browse files Browse the repository at this point in the history
  • Loading branch information
exu committed Feb 17, 2017
2 parents aef32fd + 193bc1b commit ed57fa4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/View.php
Expand Up @@ -203,4 +203,15 @@ public function filter($filter, $arguments = []) {
}
return $this->_filter;
}

public function json($data, $display = true) {
$this->content = json_encode($data);

if ($display) {
header('Content-Type: application/json');
echo $this->content;
} else {
return $this->content;
}
}
}

0 comments on commit ed57fa4

Please sign in to comment.