Created
April 22, 2014 12:07
-
-
Save Khanashima/11176280 to your computer and use it in GitHub Desktop.
共通のテンプレートにアクション毎に設定できる追加ファイルを読み込ませる ref: http://qiita.com/kiimiiis/items/c48cb7136ac88c70b724
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://localhost/fuelphp/assets/js/test.js?1398130262"></script> | |
<script type="text/javascript" src="http://localhost/fuelphp/assets/js/hello.js?1398130262"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
コンテンツ領域です | |
</div> | |
<?php | |
//テンプレートの</body>タグ直前に読み込ませたいファイルを指定。グループはjs | |
//test.js, hello.jsは/public/assets/js/配下に置く | |
Asset::js(array('test.js', 'hello.js'), array(), 'js', false); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<header> | |
<?php echo $header; ?> | |
</header> | |
<div id="content"> | |
<?php echo $content; ?> | |
</div> | |
<footer> | |
<?php echo $footer; ?> | |
</footer> | |
<?php | |
//</body>の直前にjsグループで定義したjsファイルを読み込ませる。このファイルは各アクション毎に設定 | |
//jsグループのjsファイルを表示 | |
echo Asset::render('js'); | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment