In the next stable build can you setup way to use the Model::get_validation_rules() without the need to instantiate the User Model. I can understand way currently you must instantiate the Model first.
In the A way to fetch validation rules out of Models topic stated "open to tweaking the returned array format a bit".
1 2// Used for getting validation and save data 3$user = new user();
4 5// Get all the validation from the user model 6$model_validation = $user->get_validation_rules();
7 8// CodeIgniter form class 9$this->form_validation->set_rules('password', 'Password', 'required|min_length['10 .$model_validation['password']['validates_length_of']['minimum']
11 .']');
12
Subject: Fetch validation rules out of Models
A way to fetch validation rules out of Models
How to fetch validation rules
In the next stable build can you setup way to use the Model::get_validation_rules() without the need to instantiate the User Model. I can understand way currently you must instantiate the Model first.
In the A way to fetch validation rules out of Models topic stated "open to tweaking the returned array format a bit".
Current get_validation_rules() return format:
To converting the output into something that bit more clean to deal with is bit dirty.
New format get_validation_rules() return format:
This allows for cleaner looking code in