Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6844191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:20:44+00:00 2026-05-27T00:20:44+00:00

In Kohana 3.2, passing external validation on Model_User upon save, why won’t the correct

  • 0

In Kohana 3.2, passing external validation on Model_User upon save, why won’t the correct message show?

I have user.php in application/messages/models which reads and translates fine for the “internal” data, while _external.php resides in application/messages/models/user.

When _external data is invalid, the default error message from Kohana is shown, and thus not correctly translated or given the correct labels from Model_User.

Edit, with code:

// We have $_POST, register a new user
$user = ORM::factory('user');
/*
 *    Here a bunch of variables are set
 */
$extra = Validation::factory($_POST)->
        rule('email', 'email')-> // I run this check, because in my Model_User, email is filtered through Encrypt
        rule('name', 'not_empty'); // Same goes for name

try {
    $user->save($extra);
} catch (ORM_Validation_Exception $e) {
    $this->template->errors = $e->errors('models', true);
}

So, when $extra variables don’t match the rule, I would like to get nice error messages from application/messages/models/user/_external.php, which looks like:

return array(
    'email' => array(
            'email'         => ':field must be a valid email address',
        ),
    'name' => array(
            'not_empty'     => ':field must not be empty',
        ),
);

Also, it would be nice if :field was fetched from Model_User “labels”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:20:45+00:00Added an answer on May 27, 2026 at 12:20 am

    You need to put _external.php next to your user.php in the messages/models directory, not in the messages/models/user directory. I had the same problem, it worked for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Kohana's Validation library has a pre_filter() method which lets you apply any PHP function
I'am using kohana 2.3 and i have a trouble with config/routes.php. I am redirecting
In Kohana/CodeIgniter, I can have a URL in this form: http://www.name.tld/controller_name/method_name/parameter_1/parameter_2/parameter_3 ... And then
Kohana and Codeigniter both have encode_php_tags() . I understand XSS cleaning (for Javascript), but
I have a Kohana 3.0.14 website that i want to put on multiple domains,
I have a kohana v3 app. 2 subdomains pointing to this app. what I
I need to call a Kohana helper (or any php MVC framework) from a
I'm busy building an MVC application in PHP using Kohana MVC framework, and it
In Kohana documentation 3.2, there is an validation example under ORM directory. Let me
With Kohana, using a Templating system, what is the correct way to link to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.