user1119241
user1119241

Reputation: 37

How to add new rules in Kohana framework

I'm using Kohana framework for my project development, I need to introduce new rules Suppose I have original_price and discount_price fields, for this discount_price must be always always less than or equal to original_price.

For this scenario, how to write new rule(method).

Upvotes: 1

Views: 224

Answers (2)

Mahesh.D
Mahesh.D

Reputation: 1689

In your Kohana framework,you will find validation.php file,in that write a appropriate validation function.Suppose you want to test some length of a text field then write relevant function here and call that function in your controller class using add_rules().I hope you got the answer.

Upvotes: 2

Phil
Phil

Reputation: 14661

Use v3.2 and check this page out: http://docs.kohanaphp.com/libraries/validation

Upvotes: 0

Related Questions