本文整理匯總了PHP中Inflector::rules方法的典型用法代碼示例。如果您正苦於以下問題:PHP Inflector::rules方法的具體用法?PHP Inflector::rules怎麽用?PHP Inflector::rules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Inflector
的用法示例。
在下文中一共展示了Inflector::rules方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: beforeFilter
function beforeFilter()
{
$this->RequestHandler->setContent('json', 'text/html');
$user = $this->Auth->user();
if ($user['User']['role'] !== '1') {
$this->Auth->authError = 'You must be authorized as administrator to have acces to this page.';
return false;
}
$this->Security->validatePost = false;
Inflector::rules('transliteration', array('/А/' => 'A', '/а/' => 'a', '/Б/' => 'B', '/б/' => 'b', '/В/' => 'V', '/в/' => 'v', '/Г/' => 'G', '/г/' => 'g', '/Д/' => 'D', '/д/' => 'd', '/Е|Ё/' => 'e', '/е|ё/' => 'e', '/Ж/' => 'Zh', '/ж/' => 'zh', '/З/' => 'Z', '/з/' => 'z', '/И|Й/' => 'I', '/и|й/' => 'i', '/К/' => 'K', '/к/' => 'k', '/Л/' => 'L', '/л/' => 'l', '/М/' => 'M', '/м/' => 'm', '/Н/' => 'N', '/н/' => 'n', '/О/' => 'O', '/о/' => 'o', '/П/' => 'P', '/п/' => 'p', '/Р/' => 'R', '/р/' => 'r', '/С/' => 'S', '/с/' => 's', '/Т/' => 'T', '/т/' => 't', '/У/' => 'U', '/у/' => 'u', '/Ф/' => 'F', '/ф/' => 'f', '/Х/' => 'Kh', '/х/' => 'kh', '/Ц/' => 'Ts', '/ц/' => 'ts', '/Ч/' => 'Ch', '/ч/' => 'ch', '/Ш/' => 'Sh', '/ш/' => 'sh', '/Щ/' => 'Shch', '/щ/' => 'shch', '/Ъ/' => '""', '/ъ/' => '"', '/Ы/' => 'Y', '/ы/' => 'y', '/Ь/' => '\'\'', '/ь/' => '\'', '/Э/' => 'E', '/э/' => 'e', '/Ю/' => 'Yu', '/ю/' => 'yu', '/Я/' => 'Ya', '/я/' => 'ya'));
}
示例2: array
<?php
/**
* Ajustes das inflections para português
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author Juan Basso <jrbasso@gmail.com>
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @link http://wiki.github.com/jrbasso/cake_ptbr/inflections
*/
// Alteração do inflector
$_uninflected = array('atlas', 'lapis', 'onibus', 'pires', 'virus', 'cnaes', '.*x');
$_pluralIrregular = array('abdomens' => 'abdomen', 'alemao' => 'alemaes', 'artesa' => 'artesaos', 'as' => 'ases', 'bencao' => 'bencaos', 'cao' => 'caes', 'capelao' => 'capelaes', 'capitao' => 'capitaes', 'chao' => 'chaos', 'charlatao' => 'charlataes', 'cidadao' => 'cidadaos', 'consul' => 'consules', 'cristao' => 'cristaos', 'dificil' => 'dificeis', 'email' => 'emails', 'escrivao' => 'escrivaes', 'fossel' => 'fosseis', 'germens' => 'germen', 'grao' => 'graos', 'hifens' => 'hifen', 'irmao' => 'irmaos', 'liquens' => 'liquen', 'mal' => 'males', 'mao' => 'maos', 'orfao' => 'orfaos', 'pais' => 'paises', 'pai' => 'pais', 'pao' => 'paes', 'perfil' => 'perfis', 'projetil' => 'projeteis', 'reptil' => 'repteis', 'sacristao' => 'sacristaes', 'sotao' => 'sotaos', 'tabeliao' => 'tabeliaes', 'rg' => 'rgs', 'pf' => 'pfs', 'uf' => 'ufs', 'funcao_exercida' => 'funcoes_exercidas', 'pais' => 'paises');
Inflector::rules('singular', array('rules' => array('/^(.*)(oes|aes|aos)$/i' => '\\1ao', '/^(.*)(a|e|o|u)is$/i' => '\\1\\2l', '/^(.*)e?is$/i' => '\\1il', '/^(.*)(r|s|z)es$/i' => '\\1\\2', '/^(.*)ns$/i' => '\\1m', '/^(.*)s$/i' => '\\1'), 'uninflected' => $_uninflected, 'irregular' => array_flip($_pluralIrregular)), true);
Inflector::rules('plural', array('rules' => array('/^(.*)ao$/i' => '\\1oes', '/^(.*)(r|s|z)$/i' => '\\1\\2es', '/^(.*)(a|e|o|u)l$/i' => '\\1\\2is', '/^(.*)il$/i' => '\\1is', '/^(.*)(m|n)$/i' => '\\1ns', '/^(.*)$/i' => '\\1s'), 'uninflected' => $_uninflected, 'irregular' => $_pluralIrregular), true);
Inflector::rules('transliteration', array('/À|Ã�|Â|Ã|Ä|Ã…/' => 'A', '/È|É|Ê|Ë/' => 'E', '/ÃŒ|Ã�|ÃŽ|Ã�/' => 'I', '/Ã’|Ó|Ô|Õ|Ö|Ø/' => 'O', '/Ù|Ú|Û|Ãœ/' => 'U', '/Ç/' => 'C', '/Ã�/' => 'D', '/Ñ/' => 'N', '/Å /' => 'S', '/Ã�|Ÿ/' => 'Y', '/Ž/' => 'Z', '/Æ/' => 'AE', '/ß/' => 'ss', '/Å’/' => 'OE', '/à |á|â|ã|ä|Ã¥|ª/' => 'a', '/è|é|ê|ë|&/' => 'e', '/ì|Ã|î|ï/' => 'i', '/ò|ó|ô|õ|ö|ø|º/' => 'o', '/ù|ú|û|ü/' => 'u', '/ç/' => 'c', '/ð/' => 'd', '/ñ/' => 'n', '/Å¡/' => 's', '/ý|ÿ/' => 'y', '/ž/' => 'z', '/æ/' => 'ae', '/Å“/' => 'oe', '/Æ’/' => 'f'));
unset($_uninflected, $_pluralIrregular);
示例3:
<?php
Inflector::rules('plural', ['irregular' => ['Animl.core' => 'Animl.core', 'Animl.data' => 'Animl.data']]);
示例4: array
Inflector::rules('transliteration', array(
'/À|Á|Â|Ã|Ä|Å/' => 'A',
'/È|É|Ê|Ë/' => 'E',
'/Ì|Í|Î|Ï/' => 'I',
'/Ò|Ó|Ô|Õ|Ö|Ø/' => 'O',
'/Ù|Ú|Û|Ü/' => 'U',
'/Ç/' => 'C',
'/Ð/' => 'D',
'/Ñ/' => 'N',
'/Š/' => 'S',
'/Ý|Ÿ/' => 'Y',
'/Ž/' => 'Z',
'/Æ/' => 'AE',
'/ß/'=> 'ss',
'/Œ/' => 'OE',
'/à|á|â|ã|ä|å|ª/' => 'a',
'/è|é|ê|ë|&/' => 'e',
'/ì|í|î|ï/' => 'i',
'/ò|ó|ô|õ|ö|ø|º/' => 'o',
'/ù|ú|û|ü/' => 'u',
'/ç/' => 'c',
'/ð/' => 'd',
'/ñ/' => 'n',
'/š/' => 's',
'/ý|ÿ/' => 'y',
'/ž/' => 'z',
'/æ/' => 'ae',
'/œ/' => 'oe',
'/ƒ/' => 'f'
));
示例5: testCustomSingularRule
/**
* testCustomSingularRule method
*
* @access public
* @return void
*/
function testCustomSingularRule()
{
Inflector::rules('singular', array('/(eple)r$/i' => '\\1', '/(jente)r$/i' => '\\1'));
$this->assertEqual(Inflector::singularize('epler'), 'eple');
$this->assertEqual(Inflector::singularize('jenter'), 'jente');
Inflector::rules('singular', array('rules' => array('/^(bil)er$/i' => '\\1', '/^(inflec|contribu)tors$/i' => '\\1ta'), 'uninflected' => array('singulars'), 'irregular' => array('spins' => 'spinor')));
$this->assertEqual(Inflector::singularize('inflectors'), 'inflecta');
$this->assertEqual(Inflector::singularize('contributors'), 'contributa');
$this->assertEqual(Inflector::singularize('spins'), 'spinor');
$this->assertEqual(Inflector::singularize('singulars'), 'singulars');
}
示例6: array
* Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
* advanced ways of loading plugins
*
* CakePlugin::loadAll(); // Loads all plugins at once
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
*
*/
//CakePlugin::load('DebugKit');
// Enable the Dispatcher filters for plugin assets, and
// CacheHelper.
Configure::write('Dispatcher.filters', array('AssetDispatcher', 'CacheDispatcher'));
// Add logging configuration.
CakeLog::config('debug', array('engine' => 'FileLog', 'types' => array('notice', 'info', 'debug'), 'file' => 'debug'));
CakeLog::config('error', array('engine' => 'FileLog', 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'), 'file' => 'error'));
Inflector::rules('plural', array('irregular' => array('billing' => 'billing')));
Inflector::rules('plural', array('irregular' => array('admin' => 'admin')));
if (!defined('FULL_BASE_URL')) {
define('FULL_BASE_URL', 'http://rentsquaredev.com');
}
define('USER_TYPE_MANAGER', 0);
define('USER_TYPE_TENANT', 1);
define('USER_TYPE_ADMIN', 2);
define('MSG_STATUS_UNREAD', 0);
define('MSG_STATUS_READ', 1);
define('CC_FEE', 0.0275);
define('ACH_FEE', 3.95);
define('RENTSQUARE_MERCH_USER', 'yolodesign1');
define('RENTSQUARE_MERCH_PASS', 'whLswPbvLfkrHCZHvGHp');
define('RENTSQUARE_MERCH_KEY', 'E03E49619870FD8C9885513210F4F7F7BC1AB65BFE79456E');
define('BC_SANDBOXVALUE', true);
//define('RENTSQUARE_MERCH_USER','RentSquare');
示例7: array
* 'Vendor' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
* 'Console/Command' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
* 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
* ));
*
*/
/**
* Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
* string is passed to the inflection functions
*
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
*
*/
Inflector::rules('plural', array('rules' => array('/^([^A]+)$/i' => '\\1ar', '/^([^A]+)$/i' => '\\1er'), 'irregular' => array('purring' => 'purringer', 'selger' => 'selgere', 'kaffitype' => 'kaffityper', 'postsending' => 'postsendingar', 'transportbetaling' => 'transportbetalingar', 'restbetaling' => 'restbetalingar', 'forskuddsbetaling' => 'forskuddsbetalingar', 'kaffiimport' => 'kaffiimportar', 'kaffibrenning' => 'kaffibrenningar', 'lagerverditype' => 'lagerverdityper', 'lagerverdikonto' => 'lagerverdikontoer', 'lagerverdiflytting' => 'lagerverdiflyttinger', 'kontobalanse' => 'kontobalanser', 'kunde' => 'kunder', 'faktura' => 'fakturaer', 'kaffelager' => 'kaffelagre', 'kaffepris' => 'kaffepriser', 'kaffeflytting' => 'kaffeflyttinger', 'pengeflytting' => 'pengeflyttinger', 'konto' => 'kontoer', 'selger' => 'selgere', 'rolle' => 'roller', 'lagertype' => 'lagertyper', 'fralagertype' => 'fralagertyper', 'tillagertype' => 'tillagertyper', 'fralager' => 'fralagre', 'tillager' => 'tillagre', 'kontotype' => 'kontotyper', 'adresse' => 'adresser', 'kaffetype' => 'kaffetyper', 'frakonto' => 'frakontoer', 'tilkonto' => 'tilkontoer', 'fakturaadresse' => 'fakturaadresser', 'leveringsadresse' => 'leveringsadresser', 'startsaldo' => 'startsaldoer', 'rabatt' => 'rabatter', 'varetelling' => 'varetellinger', 'beholdning' => 'beholdninger', 'kaffelagerbeholdning' => 'kaffelagerbeholdninger', 'pengetelling' => 'pengetellingar', 'InternFil' => 'InternFiler', 'intern_fil' => 'intern_filer', 'internFil' => 'internFiler', 'internfil' => 'internfiler', 'kontoutskrift' => 'kontoutskrifter', 'purrefaktura' => 'purrefakturaer', 'mvaklasse' => 'mvaklasser', 'rekning' => 'rekningar', 'leverandor' => 'leverandorar', 'tinging' => 'tingingar', 'innstilling' => 'innstillingar'), 'uninflected' => array('kaffesalgvekt', 'kaffesalg', 'kaffeflyttingvekt', 'Faktura_Ubetalt', 'bilag', 'regnskap', 'kaffiinnkjop')));
Inflector::rules('singular', array('rules' => array('/^(.+)er$/i' => '\\1', '/^(.+)ar$/i' => '\\1'), 'irregular' => array(), 'uninflected' => array('regnskap')));
/**
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
* Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
* advanced ways of loading plugins
*
* CakePlugin::loadAll(); // Loads all plugins at once
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
*
*/
/**
Copied from guide to upgrade to cake 2.2
**/
// Enable the Dispatcher filters for plugin assets, and
// CacheHelper.
Configure::write('Dispatcher.filters', array('AssetDispatcher', 'CacheDispatcher'));
示例8: array
* 'Locale' => array('/path/to/locales', '/next/path/to/locales'),
* 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'),
* 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'),
* ));
*
*/
/**
* Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
* string is passed to the inflection functions
*
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
*
*/
Inflector::rules('singular', array('rules' => array('/([rlnd])es$/i' => '\\1', '/([taeiouj])s$/i' => '\\1'), 'irregular' => array('users' => 'user', 'roles' => 'role', 'models' => 'model', 'controllers' => 'controller')));
Inflector::rules('plural', array('rules' => array('/([taeiouj])$/i' => '\\1s', '/([rlnd])$/i' => '\\1es'), 'irregular' => array('user' => 'users', 'role' => 'roles', 'model' => 'models', 'controller' => 'controllers')));
/**
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
* Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
* advanced ways of loading plugins
*
* CakePlugin::loadAll(); // Loads all plugins at once
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
*
*/
CakePlugin::loadAll();
#Definiendo la lengua español(spa) por defecto
Configure::write('Config.language', 'spa');
//Autologin debugin
Configure::write('AutoLogin', array('email' => 'chanerec@gmail.com'));
Configure::write('EmailTokenRequest', array('email_debug' => 'chanerec@gmail.com'));
示例9: array
* 'Locale' => array('/path/to/locales', '/next/path/to/locales'),
* 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'),
* 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'),
* ));
*
*/
/**
* Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
* string is passed to the inflection functions
*
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
*
*/
Inflector::rules('plural', array('rules' => array('/(.*[^aeiou])$/i' => '\\1es', '/(.*[aeiou])$/i' => '\\1s'), 'irregular' => array('rol' => 'roles', 'perfil' => 'perfiles', 'user' => 'users', 'encuestasuser' => 'encuestasUsers'), 'uninflected' => array()));
Inflector::rules('singular', array('rules' => array('/(.*[^aeiou])es$/i' => '\\1', '/(.*[aeiou])s$/i' => '\\1'), 'irregular' => array('roles' => 'rol', 'perfiles' => 'perfil', 'users' => 'user', 'encuestasusers' => 'encuestasUser'), 'uninflected' => array()));
/**
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
* Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
* advanced ways of loading plugins
*
* CakePlugin::loadAll(); // Loads all plugins at once
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
*
*/
/**
* You can attach event listeners to the request lifecyle as Dispatcher Filter . By Default CakePHP bundles two filters:
*
* - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins
* - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers
*
示例10: array
* 'View' => array('/full/path/to/views/', '/next/full/path/to/views/'),
* 'Controller' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'),
* 'Model/Datasource' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
* 'Model/Behavior' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
* 'Controller/Component' => array('/full/path/to/components/', '/next/full/path/to/components/'),
* 'View/Helper' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),
* 'Vendor' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
* 'Console/Command' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
* 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
* ));
*
*/
/**
* Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
* string is passed to the inflection functions
*
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
*
*/
Inflector::rules('singular', array('rules' => array(), 'irregular' => array('profesor' => 'profesores'), 'uninflected' => array()));
Inflector::rules('plural', array('rules' => array(), 'irregular' => array('profesores' => 'profesor'), 'uninflected' => array()));
/**
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
* Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
* advanced ways of loading plugins
*
* CakePlugin::loadAll(); // Loads all plugins at once
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
*
*/
示例11: array
<?php
Configure::write('Kinspir', array('Site' => array('url' => 'https://www.kinspir.com'), 'Email' => array('Address' => array('noreply' => 'no-reply@cloud.kinspir.com', 'support' => 'support@kinspir.com'), 'Subject' => array('invited' => '%s has invited you to Kinspir with them', 'reset' => 'Kinspir account reset', 'notification' => 'You have received a notification in Kinspir'), 'Template' => array('invited' => 'invited', 'reset' => 'reset', 'notification' => 'notification')), 'Default' => array('User' => array('invites' => 10, 'role_id' => 2, 'locale' => 'en_US', 'is_active' => 1, 'group_id' => 4, 'level_id' => 4))));
// custom inflection
// don't inflect the word css
Inflector::rules('plural', array('uninflected' => array('css')));
// set CakePHP timezone to GMT
ini_set('date.timezone', 'GMT');
// turn down error reporting
error_reporting(E_ERROR | E_WARNING | E_PARSE);
示例12: array
* 'Locale' => array('/path/to/locales', '/next/path/to/locales'),
* 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'),
* 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'),
* ));
*
*/
/**
* Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
* string is passed to the inflection functions
*
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
*
*/
Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array('contactUs', 'serverRoomAccess', 'ephiRecieved', 'ephiRemoved', 'educationCenter')));
Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array('dashboard', 'contactUs', 'serverRoomAccess', 'ephiRecieved', 'ephiRemoved', 'educationCenter')));
/**
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
* Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
* advanced ways of loading plugins
*
* CakePlugin::loadAll(); // Loads all plugins at once
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
*
*/
CakePlugin::load('AclExtras');
CakePlugin::load('Upload');
CakePlugin::load('DebugKit');
//CakePlugin::loadAll();
//CakePlugin::load('Tools');
/**
示例13: array
* To prefer app translation over plugin translation, you can set
*
* Configure::write('I18n.preferApp', true);
*/
/**
* You can attach event listeners to the request lifecycle as Dispatcher Filter. By default CakePHP bundles two filters:
*
* - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins
* - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers
*
* Feel free to remove or add filters as you see fit for your application. A few examples:
*
* Configure::write('Dispatcher.filters', array(
* 'MyCacheFilter', // will use MyCacheFilter class from the Routing/Filter package in your app.
* 'MyCacheFilter' => array('prefix' => 'my_cache_'), // will use MyCacheFilter class from the Routing/Filter package in your app with settings array.
* 'MyPlugin.MyFilter', // will use MyFilter class from the Routing/Filter package in MyPlugin plugin.
* array('callable' => $aFunction, 'on' => 'before', 'priority' => 9), // A valid PHP callback type to be called on beforeDispatch
* array('callable' => $anotherMethod, 'on' => 'after'), // A valid PHP callback type to be called on afterDispatch
*
* ));
*/
Configure::write('Dispatcher.filters', array('AssetDispatcher', 'CacheDispatcher'));
/**
* Configures default file logging options
*/
App::uses('CakeLog', 'Log');
CakeLog::config('debug', array('engine' => 'File', 'types' => array('notice', 'info', 'debug'), 'file' => 'debug'));
CakeLog::config('error', array('engine' => 'File', 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'), 'file' => 'error'));
Inflector::rules('singular', ['/(.*)res$/i' => '\\1r', '/(.*)nes$/i' => '\\1n', '/(.*)en$/i' => '\\1e', '/(.*)es$/i' => '\\1e', '/(.*)des$/i' => '\\1d', '/(.*)ses$/i' => '\\1s', '/(.*)les$/i' => '\\1l']);
Inflector::rules('plural', ['/(.*)r$/i' => '\\1res', '/(.*)e$/i' => '\\1en', '/(.*)e$/i' => '\\1es', '/(.*)n$/i' => '\\1nes', '/(.*)d$/i' => '\\1des', '/(.*)s$/i' => '\\1ses', '/(.*)l$/i' => '\\1les']);
示例14: array
//defines all the needed constants
include_once '301rewriting.php';
//do some 301 redirects
/**
* The settings below can be used to set additional paths to models, views and controllers.
* This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
*
* App::build(array(
* 'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
* 'models' => array('/full/path/to/models/', '/next/full/path/to/models/'),
* 'views' => array('/full/path/to/views/', '/next/full/path/to/views/'),
* 'controllers' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'),
* 'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
* 'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
* 'components' => array('/full/path/to/components/', '/next/full/path/to/components/'),
* 'helpers' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),
* 'vendors' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
* 'shells' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
* 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
* ));
*
*/
/**
* As of 1.3, additional rules for the inflector are added below
*
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
*
*/
Inflector::rules('plural', array('irregular' => array('surveys_taken' => 'surveys_taken')));
示例15: array
* 'Lib' => array('/path/to/libs/', '/next/path/to/libs/'),
* 'Locale' => array('/path/to/locales/', '/next/path/to/locales/'),
* 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'),
* 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'),
* ));
*
*/
/**
* Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
* string is passed to the inflection functions
*
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
*
*/
Inflector::rules('plural', array('uninflected' => array('import', 'dashboard')));
/**
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
* Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
* advanced ways of loading plugins
*
* CakePlugin::loadAll(); // Loads all plugins at once
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
*
*/
//CakePlugin::load('DebugKit');
CakePlugin::load('Wizard');
/**
* You can attach event listeners to the request lifecycle as Dispatcher Filter . By Default CakePHP bundles two filters:
*
* - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins