qbus/qbtools

Basic tools for other qbus extensions

Installs: 38

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 4

Forks: 0

Open Issues: 0

Type:typo3-cms-extension

4.0.1 2023-11-27 12:09 UTC

README

Build Status Coverage Status Scrutinizer Code Quality

Introduction

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.

Usage

$ composer require qbus/qbtools:^3.0

Quick Example

{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>