40
41

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.

CakePHP BoostCake の導入手順

Last updated at Posted at 2013-08-12

手順.1


リポジトリからソースをDL
https://github.com/slywalker/cakephp-plugin-boost_cake

手順.2


解凍後、BoostCake にリネームして /plugins/ へコピー

手順.3


/app/Config/bootstrap.php に、プラグインのロードの記述を追加

CakePlugin::load('BoostCake');

手順.4


/app/Controller/AppController.php 内に、ヘルパーを追加

class AppController extends Controller {
	public $helpers = array(
		'Session',
		'Html' => array('className' => 'BoostCake.BoostCakeHtml'),
		'Form' => array('className' => 'BoostCake.BoostCakeForm'),
		'Paginator' => array('className' => 'BoostCake.BoostCakePaginator'),
	);
}

Auth コンポーネントを利用する場合は、公式ドキュメントを参照。
http://slywalker.github.io/cakephp-plugin-boost_cake/

手順.5


/app/View/Layouts/default.php の head 要素を書き換え

<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php echo $cakeDescription ?>:
		<?php echo $title_for_layout; ?>
	</title>
	<?php

		echo $this->Html->meta('icon');

		// jQuery CDN
		echo $this->Html->script('//code.jquery.com/jquery-1.10.2.min.js');

		// Twitter Bootstrap 3.0 CDN
		echo $this->Html->css('//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css');
		echo $this->Html->script('//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/js/bootstrap.min.js');

		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
</head>

Bootstrap の CDN は、下記参照。
http://www.bootstrapcdn.com

手順.6


フォーム、ページネーション、アラートの記述方法は、公式ドキュメントを参照。
http://slywalker.github.io/cakephp-plugin-boost_cake/bootstrap3.html

その他は、従来どおり必要に応じて要素へ class を付加。

40
41
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
40
41

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?