.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ======================== EXT: Formhandler Extbase ======================== :Author: Christopher :Created: 2010-12-18T19:57:23 :Changed by: Alexander Stehlik :Changed: 2012-11-23T16:07:11 :Classification: formhandler_extbase :Author: Alexander Stehlik :Email: alexander.stehlik.deleteme@googlemail.com :Language: en .. _img-1-img-2-EXT-Formhandler-Extbase: |img-1| |img-2| EXT: Formhandler Extbase ======================================== Extension Key: formhandler\_extbase Language: en Version: 0.0.1 Keywords: Copyright 2012, Alexander Stehlik, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.org .. _Table-of-Contents: Table of Contents ----------------- **`EXT: Formhandler Extbase 1 <#__RefHeading__5708_1738894311>`_** **`Introduction 3 <#__RefHeading__5710_1738894311>`_** `What does it do? 3 <#__RefHeading__463_413120346>`_ `Screenshots 3 <#__RefHeading__465_413120346>`_ **`Users manual 4 <#__RefHeading__467_413120346>`_** `Using the demo forms 4 <#__RefHeading__3410_1478693557>`_ **`Administration 6 <#__RefHeading__31511_818911409>`_** `Edit configuration 6 <#__RefHeading__1040_258144681>`_ **`Configuration 7 <#__RefHeading__31515_818911409>`_** `Available classes 7 <#__RefHeading__3868_1478693557>`_ `Required settings 7 <#__RefHeading__4143_1478693557>`_ `Validator settings 7 <#__RefHeading__3420_1478693557>`_ **`Developers 9 <#__RefHeading__3428_1478693557>`_** `Writing a controller for formhandler\_extbase 9 <#__RefHeading__3430_1478693557>`_ **`Known problems 10 <#__RefHeading__31525_818911409>`_** **`To-Do list 11 <#__RefHeading__477_413120346>`_** **`ChangeLog 12 <#__RefHeading__31623_818911409>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ The formhandler\_extbase extension gives you the possibility to run Extbase controllers in your preprocessors, interceptors or finishers. Additionally it allows you to use Extbase validators for validating the submitted form values. .. _Features-and-targets-of-this-extention: Features and targets of this extention """""""""""""""""""""""""""""""""""""" - give developers an easy to use possibility to use their Extbase functions in Formhanlder - provide good documentation - keep it simple: since formhandler already provides a huge feature set we should be able to keep this extension lightweight To use this extension you will need a general understanding how the formhandler extension works, so if you do not know it have a look at `http://www.typo3-formhandler.com/ `_ . .. _Screenshots: Screenshots ^^^^^^^^^^^ This is the simple demo form that is included in the extension: |img-3| Users manual ------------ The first step, to get this extension up and running is importing it in the extension manager. Since it is based on the formhandler extension you will need to import and install it as a requirement. Now you are already good to go. Here is an example how to use an Extbase interceptor in your form: :: initInterceptors.1 { class = Tx_FormhandlerExtbase_Formhandler_ExtbaseInterceptor config { extensionName = FormhandlerExtbase pluginName = DemoInterceptorInit } } You need to set at least the extensionNameand the pluginNamein the configuration. At the moment is is not possible to influence the called controller or the called action. The first controller action that is configured for the given plugin will be executed. This is an example plugin configuration in your ext\_localconf.phpfile: :: Tx_Extbase_Utility_Extension::configurePlugin( $_EXTKEY, 'DemoInterceptorInit', array('Demo' => 'interceptorInit'), array('Demo' => 'interceptorInit') ); When you now use the DemoInterceptorInitplugin the interceptorInitaction will be called in the DemoController. .. _Using-the-demo-forms: Using the demo forms ^^^^^^^^^^^^^^^^^^^^ The extension comes with some demo forms. When you want to have a look at them you need to add the static TypoScript configuration for the demo forms: |img-4| Additionally you need to enable the demo plugin configuration in the extension settings: |img-5| Now you can use the demo forms in the formhandler plugin settings: |img-6| You can find the files for the demo forms in the extension folder in these directories: .. ### BEGIN~OF~TABLE ### .. _HTML-template-and-language-file: HTML template and language file """"""""""""""""""""""""""""""" .. container:: table-row Files HTML template and language file Directory :: Resources/Private/Forms/Demo .. _TypoScript-configuration-for-demo-forms: TypoScript configuration for demo forms """"""""""""""""""""""""""""""""""""""" .. container:: table-row Files TypoScript configuration for demo forms Directory :: Configuration/TypoScriptDemo .. _Configuration-for-the-demo-Extbase-plugins: Configuration for the demo Extbase plugins """""""""""""""""""""""""""""""""""""""""" .. container:: table-row Files Configuration for the demo Extbase plugins Directory :: ext_localconf.php .. ###### END~OF~TABLE ###### .. _Administration: Administration -------------- The main administration task is to create create formhandler templates and to use the Extbase classes in the TypoScript configuration. .. _Edit-configuration: Edit configuration ^^^^^^^^^^^^^^^^^^ All available classes are configured via TypoScript. The configuration options that are available can be found on the `Formhandler homepage `_ and in the Configuration section of this document. .. _Configuration: Configuration ------------- Most of the configuration is done with the default Formhandler components. But there are some additional classes that come with this extension. These will be documented here. .. _Available-classes: Available classes ^^^^^^^^^^^^^^^^^ You can uses these classes in your form configurations. The sections columns tells you, in which section of the formhandler configuration you can use them. .. ### BEGIN~OF~TABLE ### .. _Tx-FormhandlerExtbase-Formhandler-ExtbaseFinisher: Tx\_FormhandlerExtbase\_Formhandler\_ExtbaseFinisher """""""""""""""""""""""""""""""""""""""""""""""""""" .. container:: table-row Class Tx\_FormhandlerExtbase\_Formhandler\_ExtbaseFinisher Can be used in section finishers .. _Tx-FormhandlerExtbase-Formhandler-ExtbaseInterceptor: Tx\_FormhandlerExtbase\_Formhandler\_ExtbaseInterceptor """"""""""""""""""""""""""""""""""""""""""""""""""""""" .. container:: table-row Class Tx\_FormhandlerExtbase\_Formhandler\_ExtbaseInterceptor Can be used in section initInterceptors, saveInterceptors .. _Tx-FormhandlerExtbase-Formhandler-ExtbasePreProcessor: Tx\_FormhandlerExtbase\_Formhandler\_ExtbasePreProcessor """""""""""""""""""""""""""""""""""""""""""""""""""""""" .. container:: table-row Class Tx\_FormhandlerExtbase\_Formhandler\_ExtbasePreProcessor Can be used in section preProcessors .. _Tx-FormhandlerExtbase-Formhandler-ExtbaseValidator: Tx\_FormhandlerExtbase\_Formhandler\_ExtbaseValidator """"""""""""""""""""""""""""""""""""""""""""""""""""" .. container:: table-row Class Tx\_FormhandlerExtbase\_Formhandler\_ExtbaseValidator Can be used in section validators .. ###### END~OF~TABLE ###### .. _Required-settings: Required settings ^^^^^^^^^^^^^^^^^ These settings are required in all classes (except the validator): .. ### BEGIN~OF~TABLE ### .. _extensionName: extensionName """"""""""""" .. container:: table-row Property extensionName Data type string Description This settings tells Extbase in wich extension it should search for the plugin that should be executed. Example FormhandlerExtbase .. _pluginName: pluginName """""""""" .. container:: table-row Property pluginName Data type string Description This setting telle Extbase wich plugin should be called (needs to be configured in ext\_localconf.php) Example DemoPreProcessor .. ###### END~OF~TABLE ###### All settings are directly passed on the the Extbase framework which means you can access them in the settings array in your controllers. .. _Validator-settings: Validator settings ^^^^^^^^^^^^^^^^^^ The settings for extensionNames and pluginName are set to “FormhandlerExtbase” and “Validator” by default. This will run the validateAction in the ValidationController. This action will use Extbase validators to validate the user input. You can of course use your own controller for validation, but it might be easier to simply write your own Validator. To setup validation you can use these settings: .. ### BEGIN~OF~TABLE ### .. _field: field """"" .. container:: table-row Property field Data type string Description Required! Any erros that will be returned by the configured validator will be attached to this field. If you do not set a value, the field name you set here will also be used as the key for getting user input from the GET/POST array of formhandler. Default .. _validator: validator """"""""" .. container:: table-row Property validator Data type string Description Required! The name of the validator that should be used for validating the input value. You can use the short names for the default Extbase validators (e.g. NumberRange) or the full name for your own validators (e.g. Tx\_FormhandlerExtbase\_Demo\_RequiredNumberValidator) Default .. _validatorOptions: validatorOptions """""""""""""""" .. container:: table-row Property validatorOptions Data type array Description Array containing the options that will be passed to the validator, e.g.: :: validatorOptions { minimum = 10 maximum = 20 } Default .. _value: value """"" .. container:: table-row Property value Data type string /stdWrap Description By default the value that is validated is read from GET/POST data array of formhandler. The name configured in fieldis used as array key. With this setting you can overwrite this value with something else. Default .. ###### END~OF~TABLE ###### .. _Developers: Developers ---------- This extension can be used for developers, who develop Extbase based extensions and want to use some of their logic in a formhandler form. .. _Writing-a-controller-for-formhandler-extbase: Writing a controller for formhandler\_extbase ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A controller for formhandler\_extbase is not very different from any other controller you develop for Extbase. But there are some things to consider. .. _Recommended-base-class: Recommended base class """""""""""""""""""""" When you write a controller for formhandler\_extbase it is recommended to use the Tx\_FormhandlerExtbase\_Controller\_AbstractActionControllerclass as your base class. The first advantage by using this base class is, that you have direct access to the Tx\_FormhandlerExtbase\_Mvc\_FormhandlerDataobject (in $this->formhandlerData) wich gives you access to the current GP array of formhandler and lets you update GP values. The second advantage is, that you can use $this->disableViewResolution()for preventing your controller from rendering any output or an error that no template was found for the current action. .. _Returning-and-non-returning-controllers: Returning and non returning controllers """"""""""""""""""""""""""""""""""""""" For every class in formhandler you can set a returnsetting. When this setting is TRUEformhandler will stop all further processing and will ouput the content the class returned. When you write a controller, that manipulates the GP array of formhandler but does not return any content you do not need to use the returnsetting. You simple update the GP value using $this->formhandlerData->setGpValue()and use $this->disableViewResolution()to prevent the controller from rendering any content. When you write a controller that should return content, you need to set the returnsetting to 1in you formhandler class config. You can then use a fluid template for rendering content or simply return a string with the content you want formhandler to display. .. _Known-problems: Known problems -------------- Please be aware that this is a very young and notheavily tested extension. The there might be problems not yet detected. Testing and reporting problems is highly appreciated. .. _To-Do-list: To-Do list ---------- You and find the roadmap in the `forge project of this extension `_ . .. _ChangeLog: ChangeLog --------- You and find the change log in the `forge project of this extension `_ . .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 44 .. :id: graphics5 .. :name: graphics5 .. :vspace: 57 .. :width: 161 .. |img-2| image:: img-2.png .. :align: left .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 368 .. :id: Grafik1 .. :name: Grafik1 .. :width: 516 .. |img-4| image:: img-4.png .. :align: left .. :border: 0 .. :height: 136 .. :id: Grafik2 .. :name: Grafik2 .. :width: 471 .. |img-5| image:: img-5.png .. :align: left .. :border: 0 .. :height: 133 .. :id: Grafik3 .. :name: Grafik3 .. :width: 348 .. |img-6| image:: img-6.png .. :align: left .. :border: 0 .. :height: 241 .. :id: Grafik5 .. :name: Grafik5 .. :width: 245