I am having trouble setting my custom Error Messages upon Form Validations for every Rule.
I have tried it from Bonfire documentation here
Here is some code of my Model of a Module
class Content_management_system_model extends BF_Model {
protected $table_name = 'article';
protected $key = 'id';
// be updating a portion of the data.
protected $validation_rules = array(
array(
'field' => 'article_alias',
'label' => 'lang:content_management_system_article_alias',
'rules' => 'unique[article.article_alias,article.id]',
'errors' => array(
'unique' => 'This is my custom error',
),
),
And here the rules are being set from Admin Controller when Inserting
private function save_content_management_system($type = 'insert', $id = 0) {
// Validate the data
$this->form_validation->set_rules($this->content_management_system_model->get_validation_rules());
if ($this->form_validation->run() === false) {
return false;
}
But it always shows default message The value in "Article Alias" is already being used.
As per documentation in mentioned link, it should show error This is my custom error