我必須混合使用Symfony2和ExtJS4。所有視圖都需要使用ExtJS渲染,而不是樹枝。ExtJS4&Symfony 2
所有的應用程序都在安全區域,只有成員才能訪問它。
當用戶啓動應用程序時,主要視口與登錄表單一起顯示。連接後,顯示整個應用程序。
事實上,/路徑需要顯示視口。它會調用一個ajax請求來檢查用戶是否連接。
如果是,如果不啓動應用 ,顯示登錄表單
而且我不知道該怎麼做,該/動作在我的控制器等待迴應,我只想推出的JavaScript。
編輯:登錄表單必須與ExtJS。
security.yml
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/login$
security: false
secured_area:
pattern: ^/
form_login:
check_path: /login_check
login_path: /login
logout:
path: /logout
target:/
和在loginAction
public function loginAction()
{
if ($this->get('request')->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
$error = $this->get('request')->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
} else {
$error = $this->get('request')->getSession()->get(SecurityContext::AUTHENTICATION_ERROR);
}
$json = json_encode(array(
'username' => $this->get('request')->getSession()->get(SecurityContext::LAST_USERNAME),
'error' => $error,
));
$response = new Response($json);
$response->headers->set('Content-Type', 'application/json');
return $response;
}
犯錯,所以有什麼問題,你嘗試過什麼?代碼請。 – Amalea
編輯與安全和登錄操作 –