Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorklfo
    • CommentTimeApr 2nd 2008 edited
     
    hello everyone
    when i validate my mode but now i have a problem eg:

    $this->validatesPresenceOf("title"); -------->error message: title can't be blank
    $this->addError("hold_end_date", "not valid"); -------->error message: Hold end date not valid

    now i want to change errmessage "title can't be blank " to " company title cant be blank"
    and "Hold end date not valid" to " the start date cant be blank"
    because title or hold_start_date is the database field but i always must translate to something .
    how to ?
    thank you
    • CommentAuthorsalavert
    • CommentTimeApr 2nd 2008
     

    More info at ~/AkelosFramework/lib/AkActiveRecord.php documentation

    $this->validatesPresenceOf('title', array('message'=> "Company title cant be blank"));
    
    • CommentAuthorThijs
    • CommentTimeApr 2nd 2008
     

    but i always must translate to something

    Using different locales? Then it's:

    $this->validatesPresenceOf('title', $this->t("Company title cant be blank") );
    

    to have the string show up in the different locale files

Add your comments
    Username Password
  • Format comments as