Last active
December 27, 2015 09:09
-
-
Save riscos/7301689 to your computer and use it in GitHub Desktop.
TYPO3 FLOW increase integer viewhelper
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 Vendor\Package\ViewHelpers\Numbers; | |
/* * | |
* This script belongs to the TYPO3 Flow package "Vendor.Package". * | |
* * | |
* */ | |
use TYPO3\Flow\Annotations as Flow; | |
/** | |
* This ViewHelper increases an integer value by a set amount. | |
*/ | |
class IntegerIncreaseViewHelper extends \TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper { | |
/** | |
* Returns the increased number. | |
* | |
* @param integer $integer The integer to change. | |
* @param integer $by The amount to increase the integer by. | |
* @return integer The increased integer. | |
*/ | |
public function render($integer, $by = 1) { | |
$integer = intval($integer); | |
$by = intval($by); | |
return $integer + $by; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment