Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorklfo
     
    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
     

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

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

    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