Created
April 25, 2019 09:48
-
-
Save tomasnorre/ab08be61c567e4cd1c9fef952c9cbc91 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 AOE\SchedulerTimeline\ViewHelpers; | |
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; | |
/** | |
* Class IncreaseViewHelper | |
* | |
*/ | |
class IncreaseViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper | |
{ | |
use CompileWithRenderStatic; | |
protected $escapeOutput = false; | |
/** | |
* Render | |
* | |
* @param string $start | |
* @param string $end | |
* @param string $interval | |
* @param string $iterator | |
* @return string | |
*/ | |
public function render($start, $end, $interval = '1', $iterator = 'i') | |
{ | |
$escapingEnabled = $this->isChildrenEscapingEnabled(); | |
$result = ''; | |
for ($i = $start; $i < $end; $i += $interval) { | |
$this->templateVariableContainer->add($iterator, $i); | |
$result .= $this->renderChildren(); | |
$this->templateVariableContainer->remove($iterator); | |
} | |
return $result; | |
} | |
} |
This file contains hidden or 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
<div class="row hours"> | |
<div class="timeline"> | |
<s:increase start="{starttime}" end="{endtime}" interval="3600"> | |
<div class="hour"><s:format.speakingDate timestamp="{i}" /></div> | |
</s:increase> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See tweet:
https://twitter.com/tomasnorre/status/1121350986457595904