We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Callbacks for Form_validation class?

Development and Programming

airways's avatar
airways
154 posts
15 years ago
airways's avatar airways

Does anyone know of a way to get custom callbacks working with the CI Form_validation class?

The class normally requires a full CI controller which is inspected for callback methods… which doesn’t work in EE ACT actions for instance, or really anywhere at all.

Any ideas?

       
airways's avatar
airways
154 posts
15 years ago
airways's avatar airways

Well, dang it was actually pretty easy. In case anyone else ends up looking for a way to do this, it basically amounts to creating your own library class that extends CI_Form_validation, then overriding run() and/or _execute() to swap out the CI object, which is where the class looks for callbacks. Then just use your own class instead of the built-in one.

An easier way to do this that doesn’t require a custom library would be awesome, but this will do very nicely for now.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.