English 中文(简体)
Where is the appropriate place to define inflector rules in CakePHP 1.3?
原标题:

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:

最佳回答

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.





相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

Using DISTINCT in a CakePHP find function

I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list. Choose the filter ...

Assistance with CakePHP model relationships

How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity

Prevent controller from trying to autoload model

I am a beginning Cake user and trying to do some work on an already existing application. Running into a problem when I create a new controller. I have created StoreController and when I try to call ...

热门标签