1
3

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.

BootStrap!!!!!!!!

Last updated at Posted at 2015-02-16

default.ctpとは

HTMLの全体のことで

を構成しているのが、index.ctpになる
<html>
<head>
</head>
<body>
・・・・・・・・
・・・・・・・・・・
</body>
</html>

twitterbootstrapをしようする際はindex.ctpを編集していく

TwitterBootstrapの使用方法(CakePHP編)

#####①公式ホームページからダウンロード
・bootstrap-3.3.2などがダウンロードされる
・中身が、css/js/fontsになるので、それぞれをcakephp/app/webrootのcssはcss/jsはjs/fontsはそのままフォルダに入れる
・app/View/Layouts/default.ctpを編集

// Twitter Bootstrap 3.0 CDN
echo $this->Html->css('//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css');
echo $this->Html->css('style');
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');


上記を下記に変更
cssとscriptの()内をbootstrapに変更
ファイルの名前がbootstrap.css/scriptなので、()内がbootstrapに変わる


//Twitter Bootstrap 3.0 CDN
//echo $this->Html->css('cake.generic');
echo $this->Html->css('bootstrap');
echo $this->Html->script('bootstrap');
echo $this->fetch('meta');
echo $this->fetch('css');
echo $this->fetch('script');

#####②https://github.com/slywalker/cakephp-plugin-boost_cake
からプラグインをダウンロード
・プラグインはファイルを別のフォルダから読み込むもの
・あとはhttp://slywalker.github.io/cakephp-plugin-boost_cake/ 
でEnable pluginとAdd helpersをそれぞれのファイルに書き込んで終了!!

Bootsnipp(CSS用)

1
3
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
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?