25
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CakePHP3でSmartyを使う

Last updated at Posted at 2014-12-13

In :English
In :español

菊池 祐騎です。
CakePHP3.0にSmartyを入れる手順です。


2014/12/14現在最新版である
CakePHP 3.0.0-beta2
を前提とした記事です。


#CakePHPをインストール

割愛

:new: インストール方法を加筆した最新記事はこちら :point_right: http://qiita.com/yukikikuchi/items/3c0c19d17c62bdd56c8c

#SmartyViewクラスをダウンロード

https://github.com/yukikikuchi/cakephp3-smartyview
をダウンロード

#Smarty本体の設置
Smarty本家サイト
http://www.smarty.net/
からstableをとってくる
2014/12/14現在の最新版は3.1.21です。

app/vendor/smarty
にlib配下のファイルを配置

#SmartyViewを使用できるようにする

app/src/View/
にSmartyView.php
を配置

AppControllerを修正

AppController.php
class AppController extends Controller {
	public $viewClass = 'App\View\SmartyView';
// 中略
}

#レイアウトの修正

src/Template/Layout/default.tplを作成

default.tpl
{$this->fetch('content')}

完了

25
24
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
25
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?