In CakePHP 1.2, custom inflector rules could be defined in a file app/config/inflections.php. This fi开发者_如何学编程le was removed in CakePHP 1.3. Instead, the documentation prescribes using the Inflector::rules function to load custom inflections.
There's adequate documentation of how to define the custom inflections themselves, but the documentation gives no context—where to use Inflector::rules.
Should any custom inflections be defined in the bootstrap.php script? At the top of applicable corresponding controllers? Somewhere else?
See also:
- Configuration: Inflections in the documentation
- Inflector::rulesdefinition in the API documentation
The best place is at your bootstrap.php:
Inflector::rules('transliteration', array('/à|á|å|â|ã/' => 'a'));
app/config/bootstrap.php
Line 45
As of 1.3, additional rules for the inflector are added below
Says it all really.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论