summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Templates/board_index.php2
-rw-r--r--app/Templates/layout.php10
-rw-r--r--app/Templates/task_layout.php3
-rw-r--r--app/helpers.php10
4 files changed, 18 insertions, 7 deletions
diff --git a/app/Templates/board_index.php b/app/Templates/board_index.php
index 8e664219..38fb985c 100644
--- a/app/Templates/board_index.php
+++ b/app/Templates/board_index.php
@@ -39,4 +39,4 @@
</section>
-<script type="text/javascript" src="assets/js/board.js"></script>
+<?= Helper\js('assets/js/board.js') ?>
diff --git a/app/Templates/layout.php b/app/Templates/layout.php
index 0bb8446d..3e3b2e89 100644
--- a/app/Templates/layout.php
+++ b/app/Templates/layout.php
@@ -6,12 +6,12 @@
<meta name="viewport" content="width=device-width">
<meta name="mobile-web-app-capable" content="yes">
- <script src="assets/js/jquery-1.11.1.min.js"></script>
- <script src="assets/js/jquery-ui-1.10.4.custom.min.js"></script>
- <script src="assets/js/jquery.ui.touch-punch.min.js"></script>
+ <?= Helper\js('assets/js/jquery-1.11.1.min.js') ?>
+ <?= Helper\js('assets/js/jquery-ui-1.10.4.custom.min.js') ?>
+ <?= Helper\js('assets/js/jquery.ui.touch-punch.min.js') ?>
- <link rel="stylesheet" href="assets/css/app.css" media="screen">
- <link rel="stylesheet" href="assets/css/font-awesome.min.css" media="screen">
+ <?= Helper\css('assets/css/app.css') ?>
+ <?= Helper\css('assets/css/font-awesome.min.css') ?>
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<link rel="apple-touch-icon" href="assets/img/touch-icon-iphone.png">
diff --git a/app/Templates/task_layout.php b/app/Templates/task_layout.php
index ce5f36c5..cc711b78 100644
--- a/app/Templates/task_layout.php
+++ b/app/Templates/task_layout.php
@@ -14,4 +14,5 @@
</div>
</section>
</section>
-<script type="text/javascript" src="assets/js/task.js"></script> \ No newline at end of file
+
+<?= Helper\js('assets/js/task.js') ?>
diff --git a/app/helpers.php b/app/helpers.php
index 2dcb38e8..d22a4869 100644
--- a/app/helpers.php
+++ b/app/helpers.php
@@ -2,6 +2,16 @@
namespace Helper;
+function js($filename)
+{
+ return '<script type="text/javascript" src="'.$filename.'?'.filemtime($filename).'"></script>';
+}
+
+function css($filename)
+{
+ return '<link rel="stylesheet" href="'.$filename.'?'.filemtime($filename).'" media="screen">';
+}
+
function template($name, array $args = array())
{
$tpl = new \Core\Template;