Documentation · ViewHelper reference

Format / HtmlViewHelper


Renders a string by passing it to a TYPO3 parseFunc.
You can either specify a path to the TypoScript setting or set the parseFunc options directly.
By default lib.parseFunc_RTE is used to parse the string.

Examples

Default parameters

<f:format.html>foo bar. Some link.</f:format.html>

Output

foo bar. Some link.

(depending on your TYPO3 setup)

Custom parseFunc

<f:format.html parseFuncTSPath="lib.parseFunc">foo bar. Some link.</f:format.html>

Output

foo bar. Some link.

Inline notation

{someText -> f:format.html(parseFuncTSPath: 'lib.parseFunc')}

Output

foo bar. Some link.

  • Tag usage example

    <f:format.html parseFuncTSPath="'lib.parseFunc_RTE'">
    	<!-- tag content - may be ignored! -->
    </f:format.html>
  • Inline usage example

    {f:format.html(parseFuncTSPath: ''lib.parseFunc_RTE'')}

Arguments

Argument Description Type
parseFuncTSPath

path to TypoScript parseFunc setup.

string
Required attribute

Revision history

commit 38ebcedd944471b83d9293b648264fd3e65634f1
Author: Bastian Waidelich <*****@typo3.org>
Date:   Tue May 5 20:52:33 2009 +0000

    Fluid:
    * Changes backported from FLOW3:
      * major cleanup and refactoring of core and view helper classes & comments
      * added validation for boolean arguments in AbstractViewHelper
      * added initialize-method to AbstractViewHelper, that is called before render(). This was especially needed for tagbased viewhelpers.
      * renderChildren() now directly calls evaluateChildNodes() on the respective view helper node allowing us to render objects/arrays.
      * improved boolean type conversion for arguments in ViewHelperNode.
      * added TagBuilder class, re-wrote all tag based view helpers to use it (see form view helpers for some examples)
      * ViewHelperArguments collection got a new method "hasArgument()" that returns TRUE when the specified argument exists and is not NULL
    * tx_fluid changes:
      * Improved fake object factory. Now objects are injected to subclasses and implementations of the specified classes/interfaces.
      * cleaned up and tweaked view helpers. Removed Parsefunc, Stdwrap and TypoScript view helpers for now. Added CObject, If/Then/Else, EmailLink, Crop, Currency, Debug, HTML, Nl2br, Image view helpers. Thanks to Sebastian Böttger, Christopher Hlubek, Niels Pardon, Andreas Pattynama for the help!
    * Note: Unit tests not fully backported yet.

commit 50af6b9c08d04e3e1d4ce56a499a9a3d4b84efc3
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Thu May 28 21:45:46 2009 +0000

    Fluid:
    * Backported major changes from Fluid v5 to Fluid v4
    * !!! Many of these changes are not backwards-compatible! Please read this if you have written custom ViewHelpers!
    * Introduced Shorthand Syntax for calling ViewHelpers
    * Core:
    ** Lots of internal cleanup and refactorings.
    ** !!! Complete restructuring into subpackages.
    * ViewHelpers:
    ** !!! The base classes of ViewHelpers changed to Tx_Fluid_Core_ViewHelper_AbstractViewHelper and Tx_Fluid_Core_ViewHelper_TagBasedViewHelper. Please adjust your ViewHelpers!
    ** !!! $this->variableContainer has been renamed to $this->templateVariableContainer
    ** !!! the view is not in $this->variableContainer anymore. Currently there is no way to fetch the View from a ViewHelper.
    ** Introduced a new $this->controllerContext containing the context variables of the controller
    ** !!! The request can be now found in $this->controllerContext->getRequest()
    ** !!! The URIHelper has been renamed to URIBuilder and can be now found in $this->controllerContext->getURIBuilder()
    ** Introduced a new ViewHelperVariableContainer, available in $this->viewHelperVariableContainer to pass data between ViewHelpers. Should only be needed in very rare cases.
    ** !!! Removed <f:format.htmlEscape> ViewHelper! Please remove these declarations in your template! Escaping of object accessors is now automatically done, see next point.
    * !!! ObjectAccessors {...} are now automatically HTMLspecialChar'd if not used as an argument to a ViewHelper. This is done using a new ObjectAccessorPostProcessor. Lateron, this will be made configurable.

commit 796c18b4690f94f85cbed8cbbdee5be720927f2d
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Tue Jun 9 19:27:52 2009 +0000

    Fluid:
    * !!! Commented out last change of Jochen. Please add it again when you commit it @Jochen
    * Added Boolean Expression Language
    * Fixed #3551

commit 94baa46997eb185ce80e004daa9ca35c4a8d3600
Author: Bastian Waidelich <*****@typo3.org>
Date:   Mon Jun 15 12:03:04 2009 +0000

    tx_fluid: (fresh backport from Fluid Package r2609 with FluidBackporter r2611):
      [FIX] Fluid (Core): Set controller context only if not null. This needs to be done for rendering contexts without a controller context  (e.g. in a service)
      [TASK] Fluid (Core): Fixed a few doc comments
      [TASK] Fluid (Core): Removed commented-out code as it was obsolete
    
    other changes in tx_fluid:
      * AbstractFormViewHelper: Removed persistenceManager-dependency. getName() and getValue() now return correct values for domain objects. Resolves #3651
      * Adjusted doc comments of ImageViewHelper. Resolves #3394
      * Fixed a few more doc comments

commit 3197b416216c8888cfa4eab9aae67d4b89e74726
Author: Bastian Waidelich <*****@typo3.org>
Date:   Sun Aug 9 19:41:01 2009 +0000

    [~BUGFIX] Fluid (ViewHelpers): Replaced usage of $GLOBALS['TSFE']->cObj by t3lib_div::makeInstance('tslib_cObj') in CObjectViewHelper, HtmlViewHelper and ImageViewHelper. Note: In CropViewHelper & EmailViewHelper it does no harm to use $GLOBALS['TSFE']->cObj. Thanks for the patch. Resolves #4063.

commit aa1fb6f5adb8a799e79dbe54192d49b336a26786
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Tue Mar 16 08:49:45 2010 +0000

    [!!!][TASK] Fluid: Raised version number to 1.1.0. This  version needs Extbase 1.1.0 as well!
    [TASK] Fluid: Backported all changes from Fluid v5 again. This includes mostly some internal restructurings.
    [!!!][TASK] Fluid (ViewHelpers): The <f:base> ViewHelper now creates a self-closing tag instead of an opening/closing tag. This is standards-conformant, but will BREAK IE6!!

commit 186bdaeac89820779f91853b830cc95d60c7ad58
Author: Bastian Waidelich <*****@typo3.org>
Date:   Tue Jul 13 09:42:26 2010 +0000

    [-TASK] Fluid: R*****@version annotation from all Fluid classes to ease the backporting process. Relates to #8835 (backported from Fluid package)

commit 1d36de6ed90007e324b773782e8f0a1d1c1191a2
Author: Bastian Waidelich <*****@typo3.org>
Date:   Tue Jul 13 10:12:30 2010 +0000

    [-TASK] Fluid: R*****@package/@subpackage annotations from all Fluid classes. They have already been removed in FLOW3 packages in r2813.

commit 7c4adb435f5739a8574b3c28d79993ec1cae4270
Author: Bastian Waidelich <*****@typo3.org>
Date:   Mon Jul 19 18:09:46 2010 +0000

    [~TASK] Fluid (ViewHelpers): Fixed BE support of the ViewHelpers cObject, format.crop, uri.resource. Relates to #8947
    [~TASK] Fluid (ViewHelpers): Added BE support in the ViewHelpers format.html and image. Relates to #8947

commit 5c8c4d6012158d52bf1618cb25ef066d9f639f31
Author: Bastian Waidelich <*****@typo3.org>
Date:   Sun Nov 14 13:38:48 2010 +0000

    [+FEATURE] Fluid (Core/Widget): Added Tx_Fluid_Core_Widget_Bootstrap that is used to dispatch Ajax requests (see ext_typoscript_setup.txt).
    [~TASK] Fluid (Compatibility): Removed Tx_Fluid_Compatibility_ObjectManager and replaced instances by Tx_Extbase_Object_ObjectManagerInterface instances
    [~TASK] Fluid (Core/Widget): AbstractWidgetController has to be a singleton so it can be injected in the WidgetViewHelper.. To be discussed!
    [+TASK] Fluid (Core/Widget): AjaxWidgetContextHolder is now correctly stored in the BE/FE Users session if the ajaxWidget of the corresponding Widget is TRUE.
    [+TASK] Fluid (Core/Widget): The WidgetContext now contains a reference to the parent extension & plugin name. That's needed for the widgetAjaxResponse.
    [+BUGFIX] Fluid (Core/Widget): WidgetRequestBuilder now correctly interprets GET parameters and dispatches Ajax requests
    [+BUGFIX] Fluid (ViewHelpers): Modified ViewHelpers cObject, format.crop, format.html, image, uri.image so that they use dependency injection in order to retrieve the current cObject instance from the configurationManager
    [+BUGFIX] Fluid (ViewHelpers): Fixed form ViewHelper to respect configured pluginNamespace in field name prefixes
    [+BUGFIX] Fluid (ViewHelpers): link.widget/uri.widget ViewHelpers now create correct URIs
    [+BUGFIX] Fluid (ViewHelpers):*****@inject annotation by injectController method in AutocompleteViewHelper.

commit dd8928aed4c119d8db37322acb91ded24ba5cc35
Author: Bastian Waidelich <*****@typo3.org>
Date:   Thu Dec 30 16:21:11 2010 +0000

    [+TASK] Fluid (ViewHelpers): Fix, cleanup and extend inline documentation of ViewHelpers
    
    Resolves #10908

commit fd09d197fa8886b97cb20aa9573f39cd08ce989e
Author: Bastian Waidelich <*****@typo3.org>
Date:   Thu Nov 10 18:27:58 2011 +0100

    [TASK] S*****@author annotations
    
    This backports three recent changes of the TYPO3.Fluid package:
    - R*****@license annotation from files (290f4f5)
    - Simplify license header in PHP files (14bacba)
    - D*****@author tags from source code (9c2e837)
    
    This should not contain any functional change!
    
    Change-Id: I9376dca4af78c4f0f82413011d115b8ad04634dd

commit ec3891d8d4e339d8319428211207e6201be9fd73
Author: Thomas Maroschik <*****@dfau.de>
Date:   Wed Oct 17 21:18:26 2012 +0200

    [TASK][WIP] Move non class code back to source files
    
    Change-Id: I620d2e61860142cdc89cc83474c95542799961c0

commit 554e8f890dcc0dd86a27518b58e2b54be26fd37e
Author: Thomas Maroschik <*****@dfau.de>
Date:   Wed Oct 17 22:20:17 2012 +0200

    [TASK] Namespace classes
    
    Change-Id: Ia7432e1c923826ed58206bca15fb94509adbd508

commit 9d46e6932d35c79bf87c96fa38b8e537c4192f23
Author: Alexander Schnitzler <*****@typovision.de>
Date:   Tue Nov 20 16:27:02 2012 +0100

    [CLEANUP] Adjust code to CGL and fix small namespace bugs
    
    * whitespaces, tabs and blank line issues
    * bool -> boolean
    * int -> integer
    * fix wrong namespace annotations
    
    Fixes: #43157
    Releases: 6.0
    Change-Id: I8397948e19248db029d8efd1555ee56e4982742d
    Reviewed-on: http://review.typo3.org/16619
    Reviewed-by: Helmut Hummel
    Tested-by: Helmut Hummel

commit 3bdc9b1f10fb6d727a5cf9e6ebe7bdc37c5af11b
Author: Christian Kuhn <*****@schwarzbu.ch>
Date:   Sun Mar 17 23:21:15 2013 +0100

    [BUGFIX] PHP 5.4 E_STRICT warning in HtmlViewHelper
    
    Creating the TSFE instance in HtmlViewHelper raises a PHP 5.4
    warning 'Creating default Object from empty value'.
    
    Change-Id: Ie269945e4257306cd9a80b2829795c6b1c3e0969
    Releases: 6.1, 6.0, 4.7, 4.5
    Resolves: #46393
    Reviewed-on: https://review.typo3.org/18996
    Reviewed-by: Alexander Schnitzler
    Tested-by: Alexander Schnitzler
    Reviewed-by: Christian Kuhn
    Tested-by: Christian Kuhn

commit fae04a024687fd061c41d67076cfb455d189aefc
Author: Christian Kuhn <*****@schwarzbu.ch>
Date:   Wed May 1 17:57:52 2013 +0200

    [BUGFIX] Mentions of old class names
    
    Change-Id: Iee7a863a9d68d1379e1e616414b9848e0c535a8a
    Resolves: #47791
    Releases: 6.2
    Reviewed-on: https://review.typo3.org/20378
    Reviewed-by: Christian Kuhn
    Tested-by: Christian Kuhn

commit 77f29a3c69a7cbb27b34072754aa503bace6c9f1
Author: Christian Kuhn <*****@schwarzbu.ch>
Date:   Tue Oct 1 14:40:56 2013 +0200

    [TASK] Remove closing PHP tags
    
    Change-Id: Iaa92566c53301e49396fc9fb26b0b339c48d567b
    Resolves: #52360
    Releases: 6.2
    Reviewed-on: https://review.typo3.org/24212
    Reviewed-by: Christian Kuhn
    Tested-by: Christian Kuhn
    Reviewed-by: Ernesto Baschny
    Tested-by: Ernesto Baschny
    Reviewed-by: Anja Leichsenring
    Tested-by: Anja Leichsenring