Skip to content

Commit 07a74b1

Browse files
committed
make sure layout yields to template
1 parent 6e0b08b commit 07a74b1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

functions.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ function has_content($key) {
55
return isset($content[$key]);
66
}
77

8-
function yield($key, $echo = true) {
8+
function yield($key = 'default', $echo = true) {
99
global $content;
10-
10+
1111
$out = has_content($key) ? $content[$key] : '';
12-
12+
1313
if ($echo) {
1414
echo $out;
1515
} else {
@@ -20,7 +20,7 @@ function yield($key, $echo = true) {
2020
function javascripts() {
2121
global $content;
2222
if (!isset($content['javascripts'])) $content['javascripts'] = '';
23-
23+
2424
$args = func_get_args();
2525
foreach($args as $script) {
2626
if (substr($script, 0, 7) != 'http://') {
@@ -33,7 +33,7 @@ function javascripts() {
3333
function stylesheets() {
3434
global $content;
3535
if (!isset($content['stylesheets'])) $content['stylesheets'] = '';
36-
36+
3737
$args = func_get_args();
3838
foreach($args as $style) {
3939
if (substr($style, 0, 7) != 'http://') {

layouts/application.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
</header>
2424
<div role="main">
25-
25+
<?php yield(); ?>
2626
</div>
2727
<footer>
2828

0 commit comments

Comments
 (0)