How to learn TYPO3 extension programming?

Viewed 321

I am having a hard time to find in the official TYPO3 documentation information that i need. For example \TYPO3\CMS\Core\Utility\GeneralUtility and \TYPO3\CMS\Backend\Utility\BackendUtility provide many useful functions, but in the official TYPO3 documentation those functions are not documented very well or I can not seem to find them. Where could I learn about these functions?

I also did not quite understand, how to call these functions. Are those extbase functions or TYPO3-API functions?

Thanks in advance i am a beginner.

2 Answers

Okay, TYPO3 community has beautifully organized documentation so far. But, let me help you to better go! I assume, you have pretty good experience with PHP and MVC framework ;)

From the scratch, Extbase reference documentation explains structure of the extension with a simple words. see here. Initially, how you can register frontend plugin and configure plugin manually.

1. Blog example

You will find detailed explained example of blog extension. It has basic required feature for blog. It's good to get started!

URL: https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/3-BlogExample/Index.html

It has explained extension functionality and Domain of the extension. Also, you will find directory structure for the TYPO3 extension which is pretty same for all extensions.

Key point for Extension

  • Name your TYPO3 extension: Find rule for naming here.

  • folder structure and configuration files: here is detailed documentation.

You can read our nicely concluded blog at Official site.

2. Example extension: store inventory

Same as Blog example, You have another example extension available at official documentation. Check it out here

Nice thing is, Both demo extensions have code explained! How Domain modeling works, How Repository works, etc... That is super osm, isn't it?

3. Create with Ext:extension_builder

Also, you can go with extension called extension_builder that will provide all the required setup for the extension.

You can download from...

And, it has its own documentation for guideline. Check it out here and official community documentation here.

4. Extbase API documentation

This is the most useful part of the Extbase developer. I love it the most! As you have a question where you facing an issue with finding the Utility function which is provided by the TYPO3 core. You will find this easily and also you will have detailed information about use of functions and classes. Cool No?

Here you go!

For example

\TYPO3\CMS\Core\Utility\GeneralUtility, go to the document and search your class or method and select it.

enter image description here

Now, you will see each and every piece of information about class, member function, attributes, etc.

enter image description here

5. Other

extension_builder gives you a robust extension that gives you all the basic functionality like create, update, delete records, and listing and detail view for the same.

Advanced Repository and functions.

If you need a complex result set or you will need a filter from the database record then you can create a custom repository function to interact with a database. Here is nice documentation that describes powerful functions for a repository and also how you can add your own repository as well as repository functions using Individual Database Queries!

see,

Dive into documentation is the only key! I tried to collect quickly started documentation for you, hope this will help.

TYPO3 community welcome to edit this post ;)

@GNB gave you quite good clues. Agree with him, that extension_builder is good starting point. It's intuitive and you can start easily your own CRUD extensions within minutes using it.

According to your questions.

Most of methods in these classes are public static, so you just call them by using fully qualified class name like ie:

$foo = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('your-get-var');

or by using import at the beginning of your class

use TYPO3\CMS\Core\Utility\GeneralUtility;
...
$bar = GeneralUtility::_GET('your-get-var');

Documentation

Just open these classes in your IDE, they are (almost) fully described in PhpDoc - so there's no need for external documentation. Also when using properly configured IDE it will show you description of the usage just when you'll start writing name of the desired method.

PhpDoc in the GeneralUtility class

PhpDoc hint for method during writing code

Related