4

In CakePHP 1.2, custom inflector rules could be defined in a file app/config/inflections.php. This file 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:

Chuck Burgess
  • 11,600
  • 5
  • 41
  • 74
Daniel Wright
  • 4,584
  • 2
  • 27
  • 28

2 Answers2

3

The best place is at your bootstrap.php:

Inflector::rules('transliteration', array('/à|á|å|â|ã/' => 'a'));
3

app/config/bootstrap.php

Line 45

As of 1.3, additional rules for the inflector are added below

Says it all really.

Robert Love
  • 141
  • 7
  • I could change the rule that pluralizes my Payment Request Forms prf into prves, but I'm just changing the name instead :-(. Automation is good, but not -senseless- English-centric automation – George M Reinstate Monica May 25 '17 at 17:01