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:
parent
68e4f83c52
commit
ba3011a5e6
|
@ -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;
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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;
|
Loading…
Reference in a new issue