Skip to content

Instantly share code, notes, and snippets.

@simensen
Created July 28, 2014 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simensen/f9b57934e4be6f01b58a to your computer and use it in GitHub Desktop.
Save simensen/f9b57934e4be6f01b58a to your computer and use it in GitHub Desktop.
<?php
// If I copy and paste this unindented code...
$app->post('/admin/brands/{brandId}/unarchive', function (Application $app, Request $request, $brandId) {
$redirect = function () use ($app, $request) {
// TODO: Use URL Generator?
return $app->redirect($request->getBasePath() . '/admin/brands');
};
});
// It pastes as this... which is more or less exactly how it ends
// up looking if I just type it in and hit enter naturally...
$app->post('/admin/brands/{brandId}/unarchive', function (Application $app, Request $request, $brandId) {
$redirect = function () use ($app, $request) {
// TODO: Use URL Generator?
return $app->redirect($request->getBasePath() . '/admin/brands');
};
});
// What I expected is this...
$app->post('/admin/brands/{brandId}/unarchive', function (Application $app, Request $request, $brandId) {
$redirect = function () use ($app, $request) {
// TODO: Use URL Generator?
return $app->redirect($request->getBasePath() . '/admin/brands');
};
});
@simensen
Copy link
Author

@acelaya Thanks for the tip! I'll try this configuration for awhile. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment