3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

QuickForms are provided under the Plugin/QuickForms directory.

This commit is contained in:
paul121 2021-10-25 15:30:16 -07:00 committed by Michael Stenta
parent 68e4f83c52
commit ba3011a5e6
3 changed files with 6 additions and 6 deletions

View file

@ -4,18 +4,18 @@ Quick forms provide a simplified user interface for common data entry tasks.
## Building quick forms
To add a quick form, a module can provide a PHP class in `src/QuickForm` that
extends the `QuickFormBase` class.
To add a quick form, a module can provide a PHP class in `src/Plugin/QuickForm`
that extends the `QuickFormBase` class.
For example, a simplified "Egg harvest" quick form would be provided as
follows:
`src/QuickForm/Egg.php`:
`src/Plugin/QuickForm/Egg.php`:
```php
<?php
namespace Drupal\farm_egg\QuickForm;
namespace Drupal\farm_egg\Plugin\QuickForm;
use Drupal\Core\Form\FormStateInterface;
use Drupal\farm_quick\QuickFormBase;

View file

@ -24,7 +24,7 @@ class QuickFormManager extends DefaultPluginManager {
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct(
'QuickForm',
'Plugin/QuickForm',
$namespaces,
$module_handler,
'Drupal\farm_quick\QuickFormInterface',

View file

@ -1,6 +1,6 @@
<?php
namespace Drupal\farm_quick_test\QuickForm;
namespace Drupal\farm_quick_test\Plugin\QuickForm;
use Drupal\Core\Form\FormStateInterface;
use Drupal\farm_quick\QuickFormBase;