开发者

CakePHP problem with inflections

I have problem with inflections. I created a model SentSms and a controller for it called SentSmsesCon开发者_如何学JAVAtroller. It doesn't work properly so I've tried use Inflector::rules

Inflector::rules('plural', array(
    'rules' => array('/^(sms)$/i' => '\1es'),
    'irregular' => array('sms' => 'smses')
));

Inflector::rules('singular', array(
    'rules' => array('/^(sms)es$/i' => '\1'),
    'irregular' => array('smses' => 'sms')
));

But it did not help.


I'm not too familiar with custom inflections, but looks like your rules look for an exact match of "sms". Since your model is called "SentSms" it'll never match the custom rules. Try removing the ^ character (start of line) from the regex or use the full name of your model.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜