Skip to content

Commit

Permalink
Changed syntax of pseudo-foreach loop
Browse files Browse the repository at this point in the history
  • Loading branch information
kolber committed Sep 15, 2009
1 parent e91f290 commit 8da1655
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/stacey.inc.php
Expand Up @@ -487,7 +487,7 @@ function check_thumb($dir, $file) {

function parse($file) {
$file = file_get_contents($file);
preg_match('/([\S\s]*)foreach[\S\s]*{([\S\s]*)}([\S\s]*)/', $file, $matches);
preg_match('/([\S\s]*)foreach[\S\s]*:([\S\s]*)endforeach;([\S\s]*)/', $file, $matches);
return array($matches[1], $matches[2], $matches[3]);
}

Expand Down
4 changes: 2 additions & 2 deletions templates/partials/images.html
@@ -1,7 +1,7 @@
<div id="images">
foreach @Image {
foreach(@Image):
<div class="image">
<img src="@url" alt="">
</div>
}
endforeach;
</div>
4 changes: 2 additions & 2 deletions templates/partials/navigation.html
@@ -1,7 +1,7 @@
<ul id="navigation" class="col two">
foreach @Page {
foreach(@Page):
<li>
<a href="@url">@name</a>
</li>
}
endforeach;
</ul>
4 changes: 2 additions & 2 deletions templates/partials/projects.html
@@ -1,8 +1,8 @@
<ul class="projects">
foreach @Project {
foreach(@Project):
<li class="col seven">
<p class="date col one">@project_date</p>
<h2 class="col five"><img src="@thumb" class="project-thumb" alt=""><a href="@url">@project_title</a></h2>
</li>
}
endforeach;
</ul>

0 comments on commit 8da1655

Please sign in to comment.