Last active
September 23, 2019 22:14
-
-
Save uguisu-an/f956e7888761e87bd5f8117ea84d573d to your computer and use it in GitHub Desktop.
PHP Calendar Component
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
<?php | |
namespace components\calendar; | |
function render(array $weeks): void | |
{ ?> | |
<table class="table"> | |
<thead> | |
<tr> | |
<th>日</th> | |
<th>月</th> | |
<th>火</th> | |
<th>水</th> | |
<th>木</th> | |
<th>金</th> | |
<th>土</th> | |
</tr> | |
</thead> | |
<tbody> | |
<?php foreach ($weeks as $days) { ?> | |
<tr> | |
<?php foreach ($days as $day) { ?> | |
<td> | |
<?= $day ?> | |
</td> | |
<?php } ?> | |
</tr> | |
<?php } ?> | |
</tbody> | |
</table> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment