當前位置: 首頁>>代碼示例>>PHP>>正文


PHP dmString::pluralize方法代碼示例

本文整理匯總了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;
 }
開發者ID:theolymp,項目名稱:diem,代碼行數:38,代碼來源:dmModuleManagerConfigHandler.php

示例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');
開發者ID:theolymp,項目名稱:diem,代碼行數:26,代碼來源:indexSuccess.php


注:本文中的dmString::pluralize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。