src/Layout.php
public function renderJson($data, $status = 200) {
		$app = \Slim\Slim::getInstance();

		$app->response()->status($status);
		$app->response()->header('Content-Type', 'application/json');

		$body = json_encode($data);
		$app->response()->body($body);
		$app->stop();
	}
public function renderJson($data, $status = 200) {
		$app = \Slim\Slim::getInstance();

		$app->response()->status($status);
		$app->response()->header('Content-Type', 'application/json');

		$body = json_encode($data);
		$app->response()->body($body);
		$app->stop();
	}
public function renderJson ( $ data , $ status = 200 ) { $ app = \ Slim \ Slim :: getInstance ( ) ; $ app -> response ( ) -> status ( $ status ) ; $ app -> response ( ) -> header ( 'Content-Type' , 'application/json' ) ; $ body = json_encode ( $ data ) ; $ app -> response ( ) -> body ( $ body ) ; $ app -> stop ( ) ; }
New function for pre-rendering JSON without having to call disableLayout AND other rendering code.
New function for pre - rendering JSON without having to call disableLayout AND other rendering code .