当前位置: 首页>>代码示例>>PHP>>正文


PHP uc_words函数代码示例

本文整理汇总了PHP中uc_words函数的典型用法代码示例。如果您正苦于以下问题:PHP uc_words函数的具体用法?PHP uc_words怎么用?PHP uc_words使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了uc_words函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getGroupedClassName

 /**
  * Retrieve class name by class group
  *
  * NOTE: The only addition in this rewrite is the dispatch of an event,
  * which makes it easier to conditionally modify any class paths or
  * rewrites before they are instantiated.
  *
  * @param   string $groupType currently supported model, block, helper
  * @param   string $classId slash separated class identifier, ex. group/class
  * @param   string $groupRootNode optional config path for group config
  * @return  string
  */
 public function getGroupedClassName($groupType, $classId, $groupRootNode = null)
 {
     if (empty($groupRootNode)) {
         $groupRootNode = 'global/' . $groupType . 's';
     }
     $classArr = explode('/', trim($classId));
     $group = $classArr[0];
     $class = !empty($classArr[1]) ? $classArr[1] : null;
     if (isset($this->_classNameCache[$groupRootNode][$group][$class])) {
         return $this->_classNameCache[$groupRootNode][$group][$class];
     }
     $config = $this->_xml->global->{$groupType . 's'}->{$group};
     //iddqd
     // Throw event before rewrite, and verify whether the rewrite should
     // happen, dependent on the context it is being executed in.
     if (isset($config->rewrite->{$class})) {
         $eventData = new Varien_Object(array('instance' => $this, 'group' => $group, 'class' => $class));
         Mage::dispatchEvent('before_configxml_rewrite', array('config' => $eventData));
         // If returns null, or empty string, the rewrite will not happen.
         // Optionally specify another class name. This is only here as a
         // convenience. The proper way to modify this is by accessing the
         // event `instance` data and redefining the rewrite, or removing the
         // rewrite, so that the proceeding rewrite check can evaluate it.
         $class = $eventData->getData('class');
     }
     ///iddqd
     // First - check maybe the entity class was rewritten
     $className = null;
     if (isset($config->rewrite->{$class})) {
         $className = (string) $config->rewrite->{$class};
     } else {
         /**
          * Backwards compatibility for pre-MMDB extensions.
          * In MMDB release resource nodes <..._mysql4> were renamed to <..._resource>. So <deprecatedNode> is left
          * to keep name of previously used nodes, that still may be used by non-updated extensions.
          */
         if (isset($config->deprecatedNode)) {
             $deprecatedNode = $config->deprecatedNode;
             $configOld = $this->_xml->global->{$groupType . 's'}->{$deprecatedNode};
             if (isset($configOld->rewrite->{$class})) {
                 $className = (string) $configOld->rewrite->{$class};
             }
         }
     }
     // Second - if entity is not rewritten then use class prefix to form class name
     if (empty($className)) {
         if (!empty($config)) {
             $className = $config->getClassName();
         }
         if (empty($className)) {
             $className = 'mage_' . $group . '_' . $groupType;
         }
         if (!empty($class)) {
             $className .= '_' . $class;
         }
         $className = uc_words($className);
     }
     $this->_classNameCache[$groupRootNode][$group][$class] = $className;
     return $className;
 }
开发者ID:linusshops,项目名称:iddqd,代码行数:72,代码来源:Config.php

示例2: isFieldVisible

 /**
  * Check is field visible in the form
  *
  * If config model have method like useFieldName,
  * method uses it to check field visibility, otherwise returns true
  *
  * @param string $fieldName
  * @return boolean
  */
 public function isFieldVisible($fieldName)
 {
     if (method_exists($this->getConfig(), 'use' . uc_words($fieldName, ''))) {
         return $this->getConfig()->{'use' . uc_words($fieldName, '')}();
     }
     return true;
 }
开发者ID:rafaelferreiraxd,项目名称:modulos-magento,代码行数:16,代码来源:Form.php

示例3: getModuleDir

 public function getModuleDir($type, $moduleName)
 {
     if (strtolower(substr($moduleName, 0, 5)) == 'test_') {
         $dir = BP . DS . 'tests' . DS . 'integration' . DS . 'modules' . DS . uc_words($moduleName, DS);
         switch ($type) {
             case 'etc':
                 $dir .= DS . 'etc';
                 break;
             case 'controllers':
                 $dir .= DS . 'controllers';
                 break;
             case 'sql':
                 $dir .= DS . 'sql';
                 break;
             case 'data':
                 $dir .= DS . 'data';
                 break;
             case 'locale':
                 $dir .= DS . 'locale';
                 break;
         }
         $dir = str_replace('/', DS, $dir);
         return $dir;
     } else {
         return parent::getModuleDir($type, $moduleName);
     }
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:27,代码来源:Config.php

示例4: getMarkup

 /**
  * @return string
  */
 function getMarkup()
 {
     $output = "";
     switch ($this->filterType) {
         case 'bw':
             $name = $this->name;
             foreach ($this->bwValues as $key => $val) {
                 $config = array('name' => 'filter[' . $name . '][' . $key . ']');
                 $output .= "<div class='form-group'>";
                 $output .= "<label for='" . $config['name'] . "'>" . uc_words($key . " " . $name) . "</label>";
                 $this->val = $this->bwValues[$key];
                 $output .= $this->getInputMarkup($config);
                 $output .= "</div>";
             }
             break;
         case 'eq':
         case 'lt':
         case 'gt':
         default:
             $config = array('name' => 'filter[' . $this->name . ']');
             $output .= "<div class='form-group'>";
             $output .= "<label for='" . $config['name'] . "'>" . uc_words($this->name) . "</label>";
             $output .= $this->getInputMarkup($config);
             $output .= "</div>";
             break;
     }
     return $output;
 }
开发者ID:nveeed,项目名称:ems,代码行数:31,代码来源:zFilterField.php

示例5: generateData

 /**
  * @param Mage_Catalog_Model_Product        $product
  * @param Mage_Catalog_Model_Product | null $parentProduct
  *
  * @return array
  */
 public function generateData($product, $parentProduct = null)
 {
     $this->_parentProduct = $parentProduct;
     foreach (array_keys($this->_defaultRow) as $key) {
         /* clear values */
         $this->_defaultRow[$key] = null;
         $action = "_set" . uc_words($key, '', '_');
         if (empty($this->_actionCache[$action])) {
             $this->_actionCache[$action] = true;
         }
     }
     foreach (array_keys($this->_actionCache) as $_action) {
         if (method_exists($this, $_action)) {
             $this->{$_action}($product);
         }
     }
     $this->_setOptions($product);
     $this->_setAttributes($product);
     $this->_setBundleOptions($product);
     if ($this->_getConfigHelper()->getEdition() === Shopgate_Framework_Helper_Config::ENTERPRISE_EDITION && version_compare(Mage::getVersion(), '1.10', '>=')) {
         //$this->_setGiftWrapping();
     }
     $this->_parentProduct = null;
     return $this->_defaultRow;
 }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:31,代码来源:Csv.php

示例6: toOptionArray

 /**
  * @return array
  */
 public function toOptionArray()
 {
     $options = array();
     foreach ($this->_justifications as $val) {
         $options[] = array('value' => $val, 'label' => uc_words(str_replace('_', ' ', $val)));
     }
     return $options;
 }
开发者ID:ankita-parashar,项目名称:magento,代码行数:11,代码来源:ICC_Watermark_Model_Config_Source_Justification.php

示例7: _getClassName

 protected function _getClassName($type, $group, $class)
 {
     $config = Mage::getConfig()->getNode()->global->{$type . 's'}->{$group};
     $class_name = !empty($config) ? $config->getClassName() : "";
     $class_name = empty($class_name) ? 'mage_' . $group . '_' . $type : $class_name;
     $class_name .= !empty($class) ? '_' . $class : $class_name;
     return uc_words($class_name);
 }
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:8,代码来源:Conflicts.php

示例8: __autoload

/**
 * Class autoload
 *
 * @param string $class
 * @return object instance
 */
function __autoload($class)
{
    if (strpos($class, '/') !== false) {
        return;
    }
    $classFile = uc_words($class, DS) . '.php';
    include_once $classFile;
}
开发者ID:hettema,项目名称:Stages,代码行数:14,代码来源:functions.php

示例9: getValue

 /**
  * @param string $type
  * @return array|null
  */
 public function getValue($type)
 {
     $method = 'get' . uc_words($type, '');
     if (method_exists($this, $method)) {
         return $this->{$method}();
     }
     return null;
 }
开发者ID:kirchbergerknorr,项目名称:payone-magento,代码行数:12,代码来源:AreaAbstract.php

示例10: toOptionArray

 /**
  * @return array
  */
 public function toOptionArray()
 {
     $options = array();
     foreach ($this->_locations as $loc) {
         $options[] = array('value' => $loc, 'label' => uc_words(str_replace('_', ' ', $loc)));
     }
     return $options;
 }
开发者ID:ankita-parashar,项目名称:magento,代码行数:11,代码来源:ICC_Watermark_Model_Config_Source_Location.php

示例11: __autoload

/**
 * Class autoload
 *
 * @todo change to spl_autoload_register
 * @deprecated
 * @param string $class
 */
function __autoload($class)
{
    if (defined('COMPILER_INCLUDE_PATH')) {
        $classFile = $class . '.php';
    } else {
        $classFile = uc_words($class, DIRECTORY_SEPARATOR) . '.php';
    }
    include $classFile;
}
开发者ID:joshdifabio,项目名称:magento1-composer-bridge,代码行数:16,代码来源:functions.php

示例12: getRewritesList

 function getRewritesList()
 {
     $moduleFiles = glob(Mage::getBaseDir('etc') . DS . 'modules' . DS . '*.xml');
     if (!$moduleFiles) {
         return false;
     }
     // load file contents
     $unsortedConfig = new Varien_Simplexml_Config();
     $unsortedConfig->loadString('<config/>');
     $fileConfig = new Varien_Simplexml_Config();
     foreach ($moduleFiles as $filePath) {
         $fileConfig->loadFile($filePath);
         $unsortedConfig->extend($fileConfig);
     }
     // create sorted config [only active modules]
     $sortedConfig = new Varien_Simplexml_Config();
     $sortedConfig->loadString('<config><modules/></config>');
     foreach ($unsortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
         if ('true' === (string) $moduleNode->active) {
             $sortedConfig->getNode('modules')->appendChild($moduleNode);
         }
     }
     $fileConfig = new Varien_Simplexml_Config();
     $_finalResult = array();
     foreach ($sortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
         $codePool = (string) $moduleNode->codePool;
         $configPath = BP . DS . 'app' . DS . 'code' . DS . $codePool . DS . uc_words($moduleName, DS) . DS . 'etc' . DS . 'config.xml';
         $fileConfig->loadFile($configPath);
         $rewriteBlocks = array('blocks', 'models', 'helpers');
         foreach ($rewriteBlocks as $param) {
             if (!isset($_finalResult[$param])) {
                 $_finalResult[$param] = array();
             }
             if ($rewrites = $fileConfig->getXpath('global/' . $param . '/*/rewrite')) {
                 foreach ($rewrites as $rewrite) {
                     $parentElement = $rewrite->xpath('../..');
                     foreach ($parentElement[0] as $moduleKey => $moduleItems) {
                         $moduleItemsArray['rewrite'] = array();
                         $moduleItemsArray['codePool'] = array();
                         foreach ($moduleItems->rewrite as $rewriteLine) {
                             foreach ($rewriteLine as $key => $value) {
                                 $moduleItemsArray['rewrite'][$key] = (string) $value;
                                 $moduleItemsArray['codePool'][$key] = $codePool;
                             }
                         }
                         if ($moduleItems->rewrite) {
                             $_finalResult[$param] = array_merge_recursive($_finalResult[$param], array($moduleKey => $moduleItemsArray));
                         }
                     }
                 }
             }
         }
     }
     return $_finalResult;
 }
开发者ID:guohuadeng,项目名称:stampApp,代码行数:55,代码来源:Data.php

示例13: evaluateClassAlias

 /**
  * Evaluates class alias is mapped to expected class name
  *
  * @param Varien_Simplexml_Element $other
  * @return boolean
  */
 protected function evaluateClassAlias($other)
 {
     $classPrefix = $other->class;
     if (isset($other->rewrite->{$this->_classAliasName})) {
         $className = (string) $other->rewrite->{$this->_classAliasName};
     } else {
         $className = $classPrefix . '_' . uc_words($this->_classAliasName);
     }
     $this->setActualValue($className);
     return $this->_actualValue === $this->_expectedValue;
 }
开发者ID:tiagosampaio,项目名称:EcomDev_PHPUnit,代码行数:17,代码来源:ClassAlias.php

示例14: getTitle

 /**
  * 
  * @return string
  */
 public function getTitle()
 {
     $moduleName = $this->helper('erpplus')->getCurrentModuleName();
     if ($moduleName == 'Mage') {
         $moduleKey = $this->helper('erpplus')->getCurrentSectionConfig();
         $moduleName = uc_words($moduleKey);
     }
     if (strtolower($moduleName) == 'erpplus') {
         return 'ERP Plus';
     }
     return 'ERP Plus | ' . $moduleName;
 }
开发者ID:javik223,项目名称:Evron-Magento,代码行数:16,代码来源:Title.php

示例15: getConnector

 /**
  * @throws Exception
  * @param string $entity
  * @param string $type
  * @param string $name
  * @param array $params
  * @return Ess_M2ePro_Model_Connector_M2ePro_Abstract
  */
 public function getConnector($entity, $type, $name, array $params = array())
 {
     $entity = uc_words(trim($entity));
     $type = uc_words(trim($type));
     $name = uc_words(trim($name));
     $className = 'Ess_M2ePro_Model_Connector_M2ePro';
     $entity != '' && ($className .= '_' . $entity);
     $type != '' && ($className .= '_' . $type);
     $name != '' && ($className .= '_' . $name);
     $object = new $className($params);
     return $object;
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:20,代码来源:Dispatcher.php


注:本文中的uc_words函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。