Welcome Guest, Not a member yet? Register   Sign In
Form Validation Default
#1

(This post was last modified: 05-22-2016, 12:34 AM by edoramedia.)

Hi,
How can I extend the form validation throughout all my controllers but with a twist:

I have a controller called "article", one of the items that it accepts is a "slug" I would like to do a check and make sure the slug that is used is unique.

I can do this by creating a function in the article controller however I would like to make something more universal which I can call it "slug_check" and use this in multiple controllers. The issue is that I can also extend BUT each has it's own table in the database to check, for example for "article" I need it to check in the "article" table but if we have a "gallery" that also has a slug we need the "slug_check" to check BUT on the "gallery" table.

What is the best way to do this in a fashion where I do not need to create the function each time inside the controller?
Reply


Messages In This Thread
Form Validation Default - by edoramedia - 05-22-2016, 12:32 AM
RE: Form Validation Default - by skunkbad - 05-22-2016, 12:40 AM
RE: Form Validation Default - by cartalot - 05-22-2016, 12:06 PM
RE: Form Validation Default - by albertleao - 05-22-2016, 05:23 PM
RE: Form Validation Default - by cartalot - 05-26-2016, 09:49 AM
RE: Form Validation Default - by albertleao - 05-26-2016, 04:29 PM
RE: Form Validation Default - by skunkbad - 05-26-2016, 10:48 AM
RE: Form Validation Default - by mwhitney - 05-26-2016, 02:14 PM
RE: Form Validation Default - by PaulD - 05-26-2016, 09:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB