[TYPO3-mvc] Extend CropViewhelper

Thomas Allmer at at delusionworld.com
Tue Oct 11 02:16:40 CEST 2011


hey,

as it seems my solutions had numerous side affect as the crop and 
highlight function didn't always get the correct string...

anyway I now hacked the CropViewHelper.php of fluid with

public function render($maxCharacters, $stringToTruncate = NULL, ...) {
	if ($stringToTruncate === NULL) {
		$stringToTruncate = $this->renderChildren();
	}

and have a "nice" solution within my HighlightCropViewHelper.php...
with no side effects :p

https://gist.github.com/1274313

I guess I will file a bug report/feature request then... :p

cheers

On 10.10.2011 19:10, Tim Schoch | GSTALTIG wrote:
> Hi Thomas
>
> Np, you're welcome =] I had a look at your code and now I'm curious about how you use
> the content getter and setter functions. If you want to allow both child and parameter
> values, there's an easier way:
>
>    public function render( $value = NULL )
>    {
>      if ( NULL === $value ) {
>        $value = $this->renderChildren();
>      }
> ...
>
> Can be used both as<gst:test value="foo" />  and<gst:test>foo</gst:test>
> Or you can register the argument previously and then check if the arguments is set.
>
> Cheers Tim
>
> GSTALTIG GMBH / www.gstaltig.ch
> Sonnenhofstr. 13 / 6020 Emmenbrücke
> tim at gstaltig.ch / 076 488 24 97
>


-- 
+---------------------------------+-----------------------------------+
| Thomas Allmer                   |   http://www.delusionworld.com    |
| E-mail: at at delusionworld.com    |   phone: +43 699 16217064         |
+---------------------------------+-----------------------------------+


More information about the TYPO3-project-typo3v4mvc mailing list