dannykopping/Slim — comment on commit 3fdc30d98d5038ec9520420fa6d81ef9de24b8a7
File:  line 0
By dannykopping:

Interesting...

Yes, I suppose we could do that - good idea!

I was using the $data property as follows:

$app->get("/users/get", "myCallable");

$app->hook('slim.after.router', function($body)
{
$app = Slim::getInstance();

$app->contentType("application/json");
$app->response()->header("Access-Control-Allow-Origin", "*");

echo json_encode($app->response()->data());
});

function myCallable()
{
return array("name" => "danny");
}

Does that make sense? I can give you access to my bigger working example
and you can see it all in action there...

*Danny Kopping* *Flash Platform Consultant*
Adobe Certified Expert (Flash, Flex, AIR)

http://dannykopping.com | (+27) 84 941 4422

On Thu, Jan 5, 2012 at 3:43 AM, Josh Lockhart <
reply@reply.github.com
> wrote:

> What if we assigned the callable's return value to the Response body? This
> avoids the long-term need for output buffering (not that ob is a problem),
> and may also solve what you are trying to do. Just tossing around some
> ideas to hash this out.
>
> ---
> Reply to this email directly or view it on GitHub:
>
> https://github.com/dannykopping/Slim/commit/3fdc30d98d5038ec9520420fa6d81ef9de24b8a7#commitcomment-838954
>