Last active
December 16, 2015 13:48
-
-
Save smichaelsen/5443776 to your computer and use it in GitHub Desktop.
Link ViewHelper that accepts a stdWrap.typolink.parameter string
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 | |
class Tx_Myext_ViewHelpers_Link_TypolinkViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper { | |
/** | |
* @param string $parameter stdWrap.typolink style parameter string | |
* @return string | |
*/ | |
public function render($parameter) { | |
$content = $this->renderChildren(); | |
if ($parameter) { | |
/** @var $contentObject tslib_cObj */ | |
$contentObject = t3lib_div::makeInstance('tslib_cObj'); | |
$contentObject->start(array(), ''); | |
$content = $contentObject->stdWrap($content, array( | |
'typolink.' => array( | |
'parameter' => $parameter | |
) | |
)); | |
} | |
return $content; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment