LoginSignup
7
6

More than 5 years have passed since last update.

Controller間共通でHTTPヘッダを追加する方法

Posted at

以下のようにControllerのafterメソッドで行う。

fuel/app/classes/controller/public.php
class Controller_Public extends Controller_Template
{
    pubulic function after($response)
    {
        $response = parent::after($response);
        $response->set_header('X-FRAME-OPTIONS', 'SAMEORIGIN');
        return $response;
    }
}

ここで定義した「Controller_Public」を継承していく。

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6