Developing TYPO3 Extensions with Extbase and Fluid

Configuring your IDE

An Extension based on Extbase consists of many files, so it is helpful to use a PHP development environment (IDE) instead of a simple editor. Among syntax highlighting an IDE offers code completion in first place and a direct view of the code documentation. Some development environments also have an integrated debugger, which makes detecting errors easier and faster. To give you an example we’ll show you how to set up NetBeans and Eclipse for Extension development. Both IDEs have comparable functionalities, so it depends on your personal preferences which one you should use.

In general you should create projects in NetBeans repectively (????) Eclipse for Extbase and Fluid. You will be able to have a look at the Extbase and Fluid source code and the documentation whenever you need it.

Using NetBeans, in the File menu select New Project and choose PHP as category and then the entry PHP Application with Existing Sources. On the next page of the wizard you can select the Extension folder of Fluid or Extbase. If you use the development version of Extbase or Fluid you should select the directory /path-to-your-typo3-installation/typo3conf/ext/extbase/ (or .../fluid/). If you want to use the version shipped with TYPO3, you’ll find it at /path-to-your-typo3-installation/typo3/sysext/extbase/ (or .../fluid/).

Tip

By default NetBeans uses space chars for code indentation. But as the TYPO3 Coding Guidelines demand Tabs for indentation, you should configure NetBeans accordingly. Open the preferences dialogue of NetBeans and choose the entry Editor. Now, in the section Formatting, deactivate the option Expand Tabs to Spaces and adjust the options Number of Spaces per Indent and Tab Size to the same values (e.g. 4).

In Eclipse creating projects for Extbase and Fluid will work like this: Click on FileNew Project and choose Create project from existing source. Then choose the according folder for Extbase or Fluid and provide a name for the project. Click on Finish to create the project with your settings.

When developing an Extension by yourself you should also create a dedicated project for it in NetBeans or Eclipse.