Editor\Validate php extension

Editor\Validate php extension

tangerinetangerine Posts: 3,342Questions: 35Answers: 394
edited January 2014 in Editor
I want to add a "numeric or empty" method to the validation. What would be the most sensible way to extend the Validate class?

Replies

  • allanallan Posts: 61,442Questions: 1Answers: 10,053 Site admin
    Probably to modify the file directly. I don't think PHP has a way to extend a class outside of its definition. You could extend it to a custom validation class: `tangerine_validate extends Validate` for example, if you want to leave the core class unchanged.

    Regards,
    Allan
  • tangerinetangerine Posts: 3,342Questions: 35Answers: 394
    Ok, thanks Allan. I'm reluctant to hack the core, so it's going to be a custom class.
This discussion has been closed.