0

我有一个应用程序需要每 5 分钟刷新一次会话。我在 Auth Controller 中有 sessionRefreshAction。我如何通过应用程序的 Module.php 调用它。我在考虑 forward()->dispatch() 但我不知道该怎么做。谢谢

4

2 回答 2

0

You should probably create a class that you instantiate in both your controller and your Module.php that performs the common functionality.

于 2013-11-14T18:41:07.923 回答
0

在这里检查 这将解决您的问题

// Redirect to the user login page, as an example
$router   = $e->getRouter();
$url      = $router->assemble(array(), array(
    'name' => 'zfcuser/sessionrefresh'
));

$response = $e->getResponse();
$response->getHeaders()->addHeaderLine('Location', $url);
$response->setStatusCode(302);

return $response;
于 2013-11-15T12:59:13.007 回答