Можно ещё вот так:
$app->get('/', '\SiteController:actionIndex');
класс \SiteController
class SiteController extends BaseController
{
/**
* @var
*/
protected $ci;
/**
* @param Container $ci
*/
public function __construct(Container $ci)
{
$this->ci = $ci;
}
/**
* @param Request $request
* @param Response $response
* @param $args
* @return \Psr\Http\Message\ResponseInterface|Response
*/
public function actionIndex(Request $request, Response $response, $args)
{
/** @var \Slim\Views\PhpRenderer $renderer */
$renderer = $this->ci->get('view');
// some code
return $response->withRedirect('/auth/');
}
}