21288 Posts in 5733 Topics by 2602 members
General Questions
SilverStripe Forums » General Questions » Custom Module - Adding global settings to /module/_config.php
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 714 Views |
-
Custom Module - Adding global settings to /module/_config.php

26 September 2009 at 2:44pm
Hi ya
I'm working on a custom registration module, and I would like to set it up so it's own _config.php is the single point of call for configuring the module for things like form fields etc.
For instance, on the registration form, I have a password and confirm password field. When there is a registration error, I also have the form being re-populated with submitted data.
if(is_array($data)) {
$form->loadDataFrom($data);
}However i don't want this to happen for the password fields. I want them to always be blank.
So I figured I would just unset these two fields from the $data array - simple.
But I would rather have the name of these fields in a central location like _config.php to make things easier for future projects.
My question is, how do I give any of my custom objects and controllers access to any declared variable in the _config.php file? I have tried "global" as per the main _config.php and lang files, but I get undefined notices, so it's no good.
Any ideas?
Aaron
| 714 Views | ||
|
Page:
1
|
Go to Top |

