本文整理汇总了PHP中dmString::pluralize方法的典型用法代码示例。如果您正苦于以下问题:PHP dmString::pluralize方法的具体用法?PHP dmString::pluralize怎么用?PHP dmString::pluralize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dmString
的用法示例。
在下文中一共展示了dmString::pluralize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fixModuleConfig
protected function fixModuleConfig($moduleKey, $moduleConfig, $isInContent)
{
/*
* Extract plural from name
* name | plural
*/
if (!empty($moduleConfig['name'])) {
if (strpos($moduleConfig['name'], '|')) {
list($moduleConfig['name'], $moduleConfig['plural']) = explode('|', $moduleConfig['name']);
}
} else {
$moduleConfig['name'] = dmString::humanize($moduleKey);
}
if (empty($moduleConfig['model'])) {
$candidateModel = dmString::camelize($moduleKey);
$model = class_exists('Base' . $candidateModel, true) ? Doctrine_Core::isValidModelClass($candidateModel) ? $candidateModel : false : false;
} else {
$model = $moduleConfig['model'];
}
// BC "actions" deprecated keyword becomes "components"
if (isset($moduleConfig['actions'])) {
$moduleConfig['components'] = $moduleConfig['actions'];
unset($moduleConfig['actions']);
}
//security features
$securityConfig = $this->fixSecurityConfig($moduleKey, $moduleConfig);
$moduleOptions = array('name' => (string) trim($moduleConfig['name']), 'plural' => (string) trim(empty($moduleConfig['plural']) ? $model ? dmString::pluralize($moduleConfig['name']) : $moduleConfig['name'] : $moduleConfig['plural']), 'model' => $model, 'credentials' => isset($moduleConfig['credentials']) ? is_string($moduleConfig['credentials']) ? trim($moduleConfig['credentials']) : (is_array($moduleConfig['credentials']) ? $moduleConfig['credentials'] : '') : ((bool) $isInContent ? 'content' : null), 'underscore' => (string) dmString::underscore($moduleKey), 'is_project' => (bool) $isInContent || dmArray::get($moduleConfig, 'page', false) || count(dmArray::get($moduleConfig, 'components', array())), 'plugin' => $moduleConfig['plugin'], 'overridden' => dmArray::get($moduleConfig, 'overridden', false), 'has_admin' => (bool) dmArray::get($moduleConfig, 'admin', $model || !$isInContent), 'has_front' => (bool) dmArray::get($moduleConfig, 'front', true), 'components' => dmArray::get($moduleConfig, 'components', array()), 'has_security' => is_array($securityConfig), 'security' => $securityConfig, 'i18n_catalogue' => isset($moduleConfig['i18n_catalogue']) ? $moduleConfig['i18n_catalogue'] : sfConfig::get('dm_i18n_catalogue'));
if ($moduleOptions['is_project']) {
$moduleOptions = array_merge($moduleOptions, array('parent_key' => dmArray::get($moduleConfig, 'parent') ? dmString::modulize(trim(dmArray::get($moduleConfig, 'parent'))) : null, 'has_page' => (bool) dmArray::get($moduleConfig, 'page', false)));
}
// fix non array action filters
foreach ($moduleOptions['components'] as $componentKey => $componentConfig) {
if (is_array($componentConfig) && array_key_exists('filters', $componentConfig) && !is_array($componentConfig['filters'])) {
$moduleOptions['components'][$componentKey]['filters'] = array($componentConfig['filters']);
}
}
return $moduleOptions;
}
示例2: _open
<?php
echo _open('div.dm_box.big.seo_validation');
echo _tag('h1.title', __('Seo improvements'));
echo _open('div.dm_box_inner');
foreach ($duplicated as $meta => $values) {
echo _tag('h2', ucfirst(__('Duplicated %1%', array('%1%' => dmString::pluralize($meta)))));
echo _open('div.dm_table_wrap') . _open('table.dm_table');
echo _tag('thead', _tag('tr', _tag('th', $meta) . _tag('th', __('Pages'))));
toggle_init();
foreach ($values as $value => $pages) {
echo _open('tr' . toggle('.even'));
echo _tag('td', $value);
echo _open('td');
echo _open('ul');
foreach ($pages as $page) {
echo _tag('li', _tag('a.s16.s16_next.dm_toggler', $page->get('name')) . _tag('div.actions.none.dm_toggled', get_partial('pageActions', array('page' => $page, 'meta' => $meta))));
}
echo _close('ul');
echo _close('td');
echo _close('tr');
}
echo _close('table') . _close('div');
}
echo _close('div');
echo _close('div');