Skip to content

Instantly share code, notes, and snippets.

@mbrodala
Created June 26, 2015 07:59
Show Gist options
  • Save mbrodala/58878a5d757205a13d92 to your computer and use it in GitHub Desktop.
Save mbrodala/58878a5d757205a13d92 to your computer and use it in GitHub Desktop.
Test ViewHelper for https://review.typo3.org/40646
<?php
namespace Acme\MyPackage\ViewHelpers;
class BoolViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
/**
* @param bool|NULL $foo
* @return string
*/
public function render($foo = NULL) {
$result = 'Maybe';
if ($foo === TRUE) {
$result = 'Yes';
}
if ($foo === FALSE) {
$result = 'No';
}
return sprintf('Do we care? %s.', $result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment