Where is the right place to define inflector rules in CakePHP 1.3?

In CakePHP 1.2, custom inflector rules can be defined in the app/config/inflections.php file. This file has been removed in CakePHP 1.3. Instead, the documentation instructs you to use the Inflector::rules function to load custom inflections.

There is ample documentation on how to define your own custom kinks, but there is no context in the documentation โ€” where to use Inflector::rules .

Should any custom kinks be defined in the bootstrap.php script? At the top of the respective controllers? Somewhere else?

See also:

+4
source share
2 answers

Best place in your bootstrap.php:

  Inflector :: rules ('transliteration', array ('/ ร  | รก | รฅ | รข | รฃ /' => 'a'));
+3
source

application / Config / bootstrap.php

Line 45

Starting from 1.3, additional rules for the inflector are added below

Says it all really.

+3
source

Source: https://habr.com/ru/post/1310135/


All Articles