• Resolved Lukasz

    (@wpfed)


    Hi,

    Does PHP validation also use Schema-Woven Validation?
    What happens when JS is disabled or just doesn’t load for whatever reason, what does the PHP validation fall back too if it can’t read the schema file?

    Also besides schema validation being language-agnostic, at least for client side, does that mean web server language like PHP can also use it?

    I’m just trying to figure out if schema-woven validation solves the pain of having to define two places for validation of users input values, you have to make sure client and server side validation match.

    Example of how I’m doing this with Cf7: I use jQuery validation library for client side and custom/default CF7 validation hooks with PHP. Does schema-woven validation eliminate the need to use hooks and instead PHP/REST API will read schema rules?(if JS is enabled) – Follow up is it possible to define my own validation rules in the schema?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Most part of server-side validation has moved to SWV, but it directly refers to a raw PHP array image from which the schema JSON file is created. In contrast, client-side validation refers to the schema JSON file.

    I’m just trying to figure out if schema-woven validation solves the pain of having to define two places for validation of users input values, you have to make sure client and server side validation match.

    SWV can’t solve that. Its aim is to provide a ruleset of validation that can be referred from anywhere, in a language-agnostic way. Not to provide a validation logic itself. You have to (at least at this time) use JavaScript to validate on browsers, and PHP on the server.

    Thread Starter Lukasz

    (@wpfed)

    Thank you very helpful @takayukister !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Does PHP validation also use Schema-Woven Validation?’ is closed to new replies.