Editor\Validate php extension

Editor\Validate php extension

tangerinetangerine Posts: 3,365Questions: 39Answers: 395
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: 63,531Questions: 1Answers: 10,475 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,365Questions: 39Answers: 395
    Ok, thanks Allan. I'm reluctant to hack the core, so it's going to be a custom class.
This discussion has been closed.