[eluser]skunkbad[/eluser]
[quote author="ralfo" date="1251043912"]...Would be really neat and tidy if it could, otherwise I will be using the form validation class to validate form data, but my own custom classes/functions to validate URL segments (eg domain.com/order/book/345 - test that 345 is within the specified bounds using the form validation class that already exists)...[/quote]
If it were me, I'd be checking/validating '345' inside the 'book' method of the 'order' controller. This would be quite easy:
Code:
public function book($book_num)
{
if(isset($book_num) && is_int($book_num) && $book_num > 0 && $book_num < 346)
{
// do something with '1' through '345'
}
else
}
// show error message indicating that no book was selected
}
}
You can see that in this case, there really is no need to validate the URL with the form validation class. If you for some reason really do need to validate the URL, you could probably extend the form validation class, having it accept the URI segments as variables. Right now it only accepts post vars, but I don't think it could be that hard to extend.