Search code examples
typo3fluidextbasetypo3-10.x

TYPO3 Extension Development: Database Queries in Backend


This is my first time developing a TYPO3 extension, I'm using Extbase/Fluid.

So far I've been able to set up a page/module for the backend, displaying the HTML code of the template/layout. The goal is:

  1. to have a form on that page that takes an input (text) and executes a query on the database query (outside the extension) upon submit. The problem so far is that I cannot get any inline php code to work on the fluid HTML file.
  2. I also want a button to manually execute a task in the TYPO3 Scheduler. I haven't been able to find any information to help with that.

I suspect that it isn't possible to have all of this code in the template file – Any help or instructions are much appreciated.


Solution

  • welcome to TYPO3!

    1. There is no possibility for inline PHP code in the Fluid HTML file. You either can use a ViewHelper or use PHP in the ActionController you setup in the Extbase controller and assign the variables to Fluid (https://docs.typo3.org/m/typo3/book-extbasefluid/main/en-us/7-Controllers/1-Creating-Controllers-and-Actions.html). More about the general Extbase/Fluid concept you can find here: https://docs.typo3.org/m/typo3/book-extbasefluid/main/en-us/2-BasicPrinciples/1-Model-View-Controller-in-Extbase.html
    2. TYPO3 introduced the Symfony commands in v10, so you can take a look here: https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/ApiOverview/CommandControllers/Index.html