I need to create a validator plugin for a project. Writing the plugin itself it not a problem, however im unable figure out how to "activate" it. I assume that it also has to follows some sort of naming convention.
documentation does not mention anything about this. Please help.
edited by: ccc29249, Jun 12, 2009 - 08:56 AM
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Writing a Validator
-
- Rank: Registered User
- Registered: Nov 02, 2004
- Last visit: Jun 22, 2009
- Posts: 9
-
- Rank: Developer
- Registered: Feb 17, 2005
- Last visit: May 21, 2010
- Posts: 684
-
- Rank: Registered User
- Registered: Nov 02, 2004
- Last visit: Jun 22, 2009
- Posts: 9
I want to validate a time format.... yes yes i know it can easily be done with a pattern, but i wanted to make it reusable for the pnForms framework, and there is an skeleton example of such a validator in the developers section. The problem is that i really have no clue how to "activate" (register it), its not in the example. Im guesing it works pretty much the same way as normal template plugins but i cant seem to get it running. -
- Rank: Developer
- Registered: Feb 17, 2005
- Last visit: May 21, 2010
- Posts: 684
Haven't worked with this my self but in the documentation I found this
Quote
The pnFormIsValid() method will go through all validators on the page and ask them to validate themselves. If one or more validators fails then pnFormIsValid() will return false. When your code then returns false too, you tell the framework that an error occured.
here: http://community.zik…pnFormHowToValidate
Hope it helps. -
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
Quote
The pnFormIsValid() method will go through all validators on the page and ask them to validate themselves. If one or more validators fails then pnFormIsValid() will return false.
I think that is the problem he is describing. how do you register the validator as 'valid' so that it won't return false? -
- Rank: Developer
- Registered: Feb 17, 2005
- Last visit: May 21, 2010
- Posts: 684
craigh
Quote
The pnFormIsValid() method will go through all validators on the page and ask them to validate themselves. If one or more validators fails then pnFormIsValid() will return false.
I think that is the problem he is describing. how do you register the validator as 'valid' so that it won't return false?
I might be totally misunderstanding this, but I from the documentation I would say by simply returning true. I interpreted the problem to be: how to make sure that the validator function is called.
ccc29249? -
- Rank: Registered User
- Registered: Nov 02, 2004
- Last visit: Jun 22, 2009
- Posts: 9
yes Dits your absolutely spot on... no matter what i do it doesnt seem to get called / Activated
- Moderated by:
- Support
