Jump to content
thirty bees forum
  • 0

Need help with module validation


Question

Posted

Hey everyone,

Could someone please help me here, I have created a module that will install a Manufacturer logo carousel. You can see the module in action here: https://www.orren-life.com

I am however struggling to validate the module config form and display any errors. I used the PS module generator to get a module template, however I did not see any form validation code in there.

Does anyone have validation code examples for me? I have looked at other modules, however none of these are written like the generator creates teh functions.

Yup a you guessed, I don't have much experience in OOP PHP

Would appreciate any help.

4 answers to this question

Recommended Posts

  • 0
Posted

Check getContent() function. You are probably calling postProcess() in that function and than outputing the renderForm. So you can have what ever you need either in the postProcess or in the getContent.

  • 0
Posted

Thanks,

I had a look at the generator files that were created (I used the generic Module template as I don't understand what the service module would be for).

So essentially the getContent refers to renderForm, which then calls getConfigForm. Then there is getConfigFormValues and finally the postProcess.

I was trying to write the validation script in there. Which I successfully did do, however I was unable to output the values of the error message, when it found the error. So all it was doing is refreshing the form and imputing default values instead of showing the error.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...