.. include:: /Includes.rst.txt .. _configuring-the-plugin: Configuring the Plugin ====================== A plugin is a content element, that can be placed on a page like any other element (like a text element or an image). It is a "virtual" collection of one or more actions. In our example there is only one controller action combination, namely ``StoreInventory->list``. To register a plugin, we need the following code in the file :file:`ext_localconf.php`, that we create in the top level of our extension directory. .. code-block:: php 'list', ], // non-cacheable actions [ 'StoreInventory' => '', ], ); With the first line we prevent calling the PHP code in this file without TYPO3 context (this is basically a small security measure). The static method :php:`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin()` is used to configure the plugin for use in TYPO3. The first parameter denotes the extension key and vendor name (MyVendor.ExtensionKey). With the second argument we give an unique name for the plugin (in UpperCamelCase notation). This is later used to clearly identify the plugin. The third argument is an array with all allowed controller action combinations. The array key is the controller name (without the suffix ``Controller``) and the array value is a comma separated list of all allowed actions. In our case this is the ``list`` action (also without the suffix ``Action``). Thus the array :php:`['Inventory' -> 'list']` allows to execute the method :php:`listAction()` in the :php:`\MyVendor\StoreInventory\Controller\StoreInventoryController`. All actions are cached by default. If you need to have an uncached action, specify the controller/action combination as fourth parameter. In an array with the same format as the previous. Now all actions are listed whose results should not be stored in the cache. This concludes the configuration of the plugin. Now, we need to register the plugin to have it actually appear as selectable element in the backend plugin list. To achieve this insert the following line into a new file :file:`Configuration/TCA/Overrides/tt_content.php`: .. code-block:: php