Re: [請益] cakephp 多語系的問題
這部份 CakePHP 的處理比較沒有辦法使用多國語系...
建議利用 FormHelper 的 error method 來處理會比較有彈性..
http://api.cakephp.org/class/form-helper#method-FormHelpererror
或是直接在 FormHelper 中用 input method 的時候用參數指定不同的檢查錯誤
所對應的 error msg ..
http://book.cakephp.org/view/198/options-error
※ 引述《walilecow (三重捷運套房頂讓)》之銘言:
: 一般cakephp多語系好像是用po mo檔編輯
: 然後輸出時用__('message');輸出
: 或__('message',true)取出字串
: 我碰到的問題是
: model裡面可以設定欄位條件
: 例如not empty
: var $validate = array(
: 'field_name' => array(
: 'notempty' => array(
: 'rule' => array('notempty'),
: 'message' => '錯誤訊息在這裡設定'
: //'allowEmpty' => false,
: //'required' => false,
: //'last' => false, // Stop validation after this rule
: //'on' => 'create', // Limit validation to 'create' or 'update' operations
: ),
: )
: );
: 但是message我想要設定多語系...
: 不知道如何做到...
: 直接__('notempty')會出現錯誤
: 希望問題不會太笨@@
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.116.62.60
→
03/08 19:37, , 1F
03/08 19:37, 1F
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章