owzim Posted October 12, 2014 Posted October 12, 2014 I have a Module, which is an InputField, I have some custom settings, which is accessible via the input tab on the field edit page. I want to validate the settings given by the user. What I have so far (like suggested here): $this->addHookAfter('InputField::processInput', $this, 'HookValidateSettingsInput'); public function HookValidateSettingsInput(HookEvent $event){ $inputfield = $event->object; // unsafe because there can be other fields with that name on other templates // and this hook would trigger there as well if ($inputfield->name == "nameOfTheInputField") { // do stuff } } But this is totally unsafe. How can I check if the currently processed inputfield (which is a text area in this case) belongs to the InputFiled settings of my module. I can't find any reference within the $event->object, just a bunch of input field wrappers with numbers. Thanks.
owzim Posted October 12, 2014 Author Posted October 12, 2014 Horst to the rescue: $event->arguments[0]->type; // spits out the actual Fieldtype class name 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now