projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c688dcf
)
JsTemplate.php
author
Alan Knowles
<alan@akbkhome.com>
Thu, 17 Nov 2011 09:25:09 +0000
(17:25 +0800)
committer
Alan Knowles
<alan@akbkhome.com>
Thu, 17 Nov 2011 09:25:09 +0000
(17:25 +0800)
JsTemplate.php
patch
|
blob
|
history
diff --git
a/JsTemplate.php
b/JsTemplate.php
index
1dc81bf
..
2639bb2
100644
(file)
--- a/
JsTemplate.php
+++ b/
JsTemplate.php
@@
-56,14
+56,21
@@
class Pman_Core_JsTemplate extends Pman {
$dir = dirname($mod) . '/jtemplates';
if (!file_exists($dir)) {
echo '// missing directory '. htmlspecialchars($dir) ."\n";
$dir = dirname($mod) . '/jtemplates';
if (!file_exists($dir)) {
echo '// missing directory '. htmlspecialchars($dir) ."\n";
+ continue;
}
// got a directory..
$mn = basename(dirname($mod));
}
// got a directory..
$mn = basename(dirname($mod));
-
+ $ar = glob("$dir/*.html") ;
+ if (empty($ar)) {
+ echo '// no template is directory '. htmlspecialchars($dir) ."\n";
+ continue;
+ }
+ echo "Pman.{$mn} = Pman.{$mn} || {};\n";
+ echo "Pman.{$mn}.template = Pman.{$mn}.template || {};\n\n";
foreach(glob("$dir/*.html") as $fn) {
foreach(glob("$dir/*.html") as $fn) {
- $name = 'Pman.' . $mn .'.' . preg_replace('/\.html$/i', '', basename($fn));
- echo $this->compile($fn, $name);
+ $name = 'Pman.' . $mn .'.
template.
' . preg_replace('/\.html$/i', '', basename($fn));
+ echo $this->compile($fn, $name)
. "\m"
;
}
}