すべてのビューについてヘッダーを設定したいのですがarray('Cache-Control'=>'no-cache, no-store, max-age=0, must-revalidate','Pragma'=>'no-cache','Expires'=>'Fri, 01 Jan 1990 00:00:00 GMT');
、現在、ビューを返しながらすべてのコントローラーでこれを行っています。
$headers=array('Cache-Control'=>'no-cache, no-store, max-age=0, must-revalidate','Pragma'=>'no-cache','Expires'=>'Fri, 01 Jan 1990 00:00:00 GMT');
Redirect::to('/',301,$headers);`
したがって、ルートごとにこれを記述する代わりに、グローバル スコープで実行できるため、すべてのビューにヘッダーが設定されます。
after フィルターを作成してヘッダーを設定しようとしましたが、うまくいきませんでした。
すべてのビューのヘッダーをどこに設定できますか?
UPDATE ビューファイルのメタコンテンツの1つ
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>
今私が使用するときRedirect::to('/',301,$headers)
、firebugのヘッダーは
Cache-Control max-age=0, must-revalidate, no-cache, no-store, private
Connection Keep-Alive
Content-Type text/html; charset=UTF-8
Date Tue, 09 Jul 2013 14:52:08 GMT
Expires Fri, 01 Jan 1990 00:00:00 GMT
そして、私が使用するときRedirect::to('/');
firebugのヘッダーは
Cache-Control no-cache
Connection Keep-Alive
Content-Type text/html; charset=UTF-8
Date Tue, 09 Jul 2013 14:52:08 GMT