Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying TYPO3 Extension Development
  • Table Of Contents Toc
  • Feedback & Rating feedback
TYPO3 Extension Development

TYPO3 Extension Development

4.5 (2)
close
close
TYPO3 Extension Development

TYPO3 Extension Development

4.5 (2)

Overview of this book

Table of Contents (13 chapters)
close
close

Implementing a Frontend Hook


The Frontend hook class file goes into the extension's directory. The file is named class.tx_feuserstat_hooks.php. According to coding conventions, the class name becomes tx_feuserstat_hooks. There will be only one hook inside but we name the file (and the class) in plural to enable adding more hooks if necessary in future versions.

When adding this class, GPL and XCLASS declarations should be added manually. Make sure you do this first thing after creating a new class for TYPO3.

Now, we create a dummy function for the hook. The function name has to be checkDataSubmission because it is hard-coded like this in the TSFE.

The TSFE provides a reference to itself as a parameter to the hook function. The same reference is available as $GLOBALS['TSFE']. For better clarity, we will use the global variable and will skip the function parameter completely.

Next, we need to register the hook. We do it by adding the following code to ext_localconf.php:

$GLOBALS['TYPO3_CONF_VARS...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
TYPO3 Extension Development
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon