Search the Community
Showing results for tags 'ConfigurableModule'.
-
First, I am running PW 2.4.12, so I realize this might be a beta bug that is fixable by me upgrading, but I'm following examples that have been around for a while, so I figured I would ask. I am following the wiki's example for making a configurable module and it creates the fields properly, but is not storing the default values on install. In the __construct() method I have tried both variants: # variant 1 $this->foo = 'value'; # variant 2 $this->set('foo', 'value'); And then my getModuleConfigInputFields(array $data) method has: $inputfields = new InputfieldWrapper(); $field = wire('modules')->get('InputfieldText'); $field->name = 'foo'; $field->label = 'Label for foo'; if ( isset($data['foo']) ) { $field->value = $data['foo']; } $inputfields->add($field); return $inputfields; After install, the module shows the field, but its value is blank. I've confirmed the 'data' field in the modules table is blank, too. At this point, I can enter a value, click submit, and the 'data' field is updated and reflects in the form. Is there an additional method call needed in my __install() to trigger storing these default values?
- 5 replies
-
- development
- module
-
(and 1 more)
Tagged with:
-
Hi, I create a little module that extends Process and creates a page in backend under setup. I need to store and retrieve a few (config)data for it, but don't want to make it a ConfigurableModule because than I have redundant places where I can setup config-data , I guess. How can I store / retrieve some data into the place where modules store it by default, but without implementing ConfigurableModule?
- 9 replies
-
- module
- ConfigurableModule
-
(and 1 more)
Tagged with: