Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement to laminas-validator documentation #95

Open
tempfirstuser opened this issue Mar 4, 2021 · 3 comments
Open

Improvement to laminas-validator documentation #95

tempfirstuser opened this issue Mar 4, 2021 · 3 comments

Comments

@tempfirstuser
Copy link

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

I use apigility (yes, I didn't upgraded yet) for REST/RPC requests from ajax calls which means I configure everything in config files.
I just needed to create custom validator which will search in db if record exists with some conditions. I was trying to create service factory for that and pass service manager (which use doctrine) to validator __construct method, but it looks like doesn't work in such way. I was trying to do like this:

'service_manager' => [
	'factories' => [
	    Validator\EmailExistsAndConfirmed::class        => Validator\Factory\EmailExistsAndConfirmedFactory::class,
	],
],

but it doesn't work.

I didn't find anything on docs about that I should create validator factory and put it into config like this:

'validators' => [
	'factories' => [
	    Validator\EmailExistsAndConfirmed::class        => Validator\Factory\EmailExistsAndConfirmedFactory::class,
	],
],

It would be great to keep such hint in docs. If I missed this in docs, then sorry about that.

@settermjd
Copy link
Contributor

Thanks for reporting this, @tempfirstuser. I'll do a little bit of research and experimentation and then update the docs accordingly.

@froschdesign
Copy link
Member

@settermjd
The entire description for the validator plugin manager is missing and a cookbook recipe, how to register a custom validator in a laminas-mvc based application.

@settermjd
Copy link
Contributor

Saw that. I'm just getting myself back up to speed with knowing how it all works again and I'll get the documentation updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants