This extension provides a set of ViewHelpers
and Hooks
that are used
to implement TYPO3 based websites by Qbus.
Some ViewHelpers (like qbtools:fetch
or qbtools:fal
) are not meant
to be used as preferred solution, but are rather available when a proper
implementation (using repository classes) is not possible – e.g. when
data needs to be retrieved from the database in a template of a generic
community extension.
$ composer require qbus/qbtools:^3.0
{namespace qbtools=Qbus\Qbtools\ViewHelpers}
<!-- Fetch (top) blog posts of some Extbase model and display using
a partial of some (external) extension. -->
<qbtools:fetch model="Vendor\\MyBlog\\Domain\\Model\\Post" match="{top: 1}" as="posts">
<f:for each="{posts}" as="post">
<qbtools:renderExternal partial="Blog/Teaser" extensionName="MyBlog" arguments="{post: post}"/>
</f:for>
</qbtools:fetch>
<!-- Render content from page with uid 340 -->
<qbtools:renderContent pid="340"/>
<!-- Render colPos 1 content from page with uid 340 -->
<qbtools:renderContent pid="340" colpos="1" />
<!-- Render content element with uid 230 -->
<qbtools:renderContent uid="230"/>
<!-- Quick an dirty call to a PHP function -->
<qbtools:call func="str_replace" params="{0: '_', 1: ' ', 2: 'foo_bar'}" as="result">
<!-- will print 'foo bar' -->
{result}
</qbtools:call>