I’m not sure how to get external error messages to show.
Field
<?php echo Form::input('membername', $username, array('id' => 'username')); ?><?php echo Arr::get($errors, 'membername');?>
Controller
try
{
$extra_rules = Validation::factory($this->request->post())
->rule('membername', 'not_empty');
$username->update($extra_rules);
}
catch (ORM_Validation_Exception $ex)
{
$errors = $ex->errors('models/user');
}
/models/user/_external.php
return array(
'membername' => array(
'not_empty' => 'You must provide a member name.',
),
);
When the field is empty no error messages appear.
I guess Kohana can’t find the correct message, and therefore shows nothing.
If
membernameis a member of your modeluser, the error message should be defined in/models/user.phpinstead of/models/user/_external.php.Edit:
If
membernameis not a member of the model, the error should be available via :<?php echo Arr::path($errors, '_external.membername'); ?>