LoginSignup
2
2

More than 5 years have passed since last update.

【Fuelphp】 Template クラスを拡張する。

Last updated at Posted at 2014-08-22

fuelphpでのTemplateクラスをオーバライドして拡張を行う。

APPPATH.'classes/controller/'に template.php を作成。

APPPATH.'classes/controller/template.php'
class Controller_Template extends Controller
{
・・・
}

Controllerを継承して作成。

app/bootstrap.php を編集。

app/bootstrap.php
Autoloader::add_classes(array(
    // Add classes you want to override here
    // Example: 'View' => APPPATH.'classes/view.php',
        'Controller_Template' => APPPATH.'classes/controller/template.php',
));

templateクラスを使用するContorllerクラスは継承元を
Fuel\Core\Controller_Template 

Controller_Template
に変更する。

<完了>

2
2
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
2
2