k01ken’s b10g

He110 W0r1d!

CakePHP3でプラグイン(FriendsOfCake/bootstrap-ui)を用いてBootstrapを使う

開発環境は、Windows 10 Pro(64bit) + PHP 7.2.12 + CakePHP 3.6.14。

1.composer.jsonを開いて、requireの中に以下を追加

"friendsofcake/bootstrap-ui": "^1.4",

2.コマンドプロンプトからcomposer updateでプラグインをインストール

3.config/bootstrap.php内に、

Plugin::load('BootstrapUI');

を追加する

4.src/View/AppView.phpを開いて、
上部に、

use BootstrapUI\View\UIView;

を追加し、

class AppView extends View

class AppView extends UIView

に変更する。

5.src/Application.php内のbootstrap()メソッド内に、

$this->addPlugin('BootstrapUI');

を追加する。


参考サイト

GitHub - FriendsOfCake/bootstrap-ui: CakePHP3: Transparently use Bootstrap
・公式ページ(英語)。使い方も書いている。