本文整理汇总了PHP中uc_words函数的典型用法代码示例。如果您正苦于以下问题:PHP uc_words函数的具体用法?PHP uc_words怎么用?PHP uc_words使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uc_words函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: _prepareColumns
protected function _prepareColumns()
{
$results = $this->_getSqlQueryResults();
if (!empty($results)) {
$cols = array_keys($results[0]);
foreach ($cols as $col) {
$header = uc_words($col, ' ');
$this->addColumn($col, array('header' => Mage::helper('bubble_qgrid')->__($header), 'index' => $col, 'type' => 'text', 'sortable' => false));
}
}
return parent::_prepareColumns();
}
开发者ID:technomagegithub,项目名称:magento-query-grid,代码行数:12,代码来源:Grid.php
示例17: _getVariable
protected function _getVariable($value, $default = '{no_value_defined}')
{
Varien_Profiler::start("email_template_proccessing_variables");
$tokenizer = new Varien_Filter_Template_Tokenizer_Variable();
$tokenizer->setString($value);
$stackVars = $tokenizer->tokenize();
$result = $default;
$last = 0;
for ($i = 0; $i < count($stackVars); $i++) {
if ($i == 0 && isset($this->_templateVars[$stackVars[$i]['name']])) {
// Getting of template value
$stackVars[$i]['variable'] =& $this->_templateVars[$stackVars[$i]['name']];
} elseif (isset($stackVars[$i - 1]['variable']) && $stackVars[$i - 1]['variable'] instanceof Varien_Object) {
// If object calling methods or getting properties
if ($stackVars[$i]['type'] == 'property') {
$caller = "get" . uc_words($stackVars[$i]['name'], '');
if (is_callable(array($stackVars[$i - 1]['variable'], $caller))) {
// If specified getter for this property
$stackVars[$i]['variable'] = $stackVars[$i - 1]['variable']->{$caller}();
} else {
$stackVars[$i]['variable'] = $stackVars[$i - 1]['variable']->getData($stackVars[$i]['name']);
}
} else {
if ($stackVars[$i]['type'] == 'method') {
// Calling of object method
if (is_callable(array($stackVars[$i - 1]['variable'], $stackVars[$i]['name'])) || substr($stackVars[$i]['name'], 0, 3) == 'get') {
$stackVars[$i]['variable'] = call_user_func_array(array($stackVars[$i - 1]['variable'], $stackVars[$i]['name']), $stackVars[$i]['args']);
}
}
}
$last = $i;
} elseif (isset($stackVars[$i - 1]['variable']) && is_object($stackVars[$i - 1]['variable'])) {
if ($stackVars[$i]['type'] == 'property' && isset($stackVars[$i - 1]['variable']->{$stackVars[$i]['name']})) {
$stackVars[$i]['variable'] = $stackVars[$i - 1]['variable']->{$stackVars[$i]['name']};
} else {
if ($stackVars[$i]['type'] == 'method') {
// Calling of object method
if (is_callable(array($stackVars[$i - 1]['variable'], $stackVars[$i]['name']))) {
$stackVars[$i]['variable'] = call_user_func_array(array($stackVars[$i - 1]['variable'], $stackVars[$i]['name']), $stackVars[$i]['args']);
}
}
}
$last = $i;
}
}
if (isset($stackVars[$last]['variable'])) {
// If value for construction exists set it
$result = $stackVars[$last]['variable'];
}
Varien_Profiler::stop("email_template_proccessing_variables");
return $result;
}
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:52,代码来源:TemplateFilter.php
示例18: getColumnHeaderName
public function getColumnHeaderName($key)
{
// Beautify column key
$key = trim(str_replace('_', ' ', strtolower($key)));
// Play on words case for translation
// Try three of the whole possibilities, which should represent most of the successfull ones
$helper = Mage::helper('adminhtml');
if ($key === ($result = $helper->__($key)) && ucfirst($key) === ($result = $helper->__(ucfirst($key))) && uc_words($key, ' ', ' ') === ($result = $helper->__(uc_words($key, ' ', ' ')))) {
// Use basic key if no translation succeeded
$result = uc_words($key, ' ', ' ');
}
return $result;
}
开发者ID:aram93,项目名称:mage-enhanced-admin-grids,代码行数:13,代码来源:Data.php
示例19: _createExportLine
/**
* Creates a new export line instance.
*
* @param \SixBySix_RealTimeDespatch_Model_Export $export
* @param \SixBySix\RealtimeDespatch\Report\ImportReportLine $reportLine
*
* @return SixBySix_RealTimeDespatch_Model_Export
*/
protected function _createExportLine($export, $reportLine)
{
$exportLine = Mage::getModel('realtimedespatch/export_line');
$exportLine->setExport($export);
$exportLine->setType($reportLine->getResult());
$exportLine->setReference($reportLine->getExternalReference());
$exportLine->setOperation(uc_words($reportLine->getOperation()));
$exportLine->setEntity($export->getEntity());
$exportLine->setMessage($reportLine->getMessage());
$exportLine->setDetail($reportLine->getDetail());
$exportLine->setProcessed($reportLine->getTimestamp());
return $exportLine;
}
开发者ID:pierre-pizzetta,项目名称:orderflow-magento-module,代码行数:21,代码来源:Export.php
示例20: getConnector
/**
* @throws Exception
* @param string $entity
* @param string $type
* @param string $name
* @param array $params
* @param null|Ess_M2ePro_Model_Account $accountModel
* @param null|string $ormPrefixToConnector
* @return Ess_M2ePro_Model_Connector_Translation_Requester|Ess_M2ePro_Model_Connector_Translation_Abstract
*/
public function getConnector($entity, $type, $name, array $params = array(), Ess_M2ePro_Model_Account $accountModel = NULL, $ormPrefixToConnector = NULL)
{
$className = empty($ormPrefixToConnector) ? 'Ess_M2ePro_Model_Connector_Translation' : $ormPrefixToConnector;
$entity = uc_words(trim($entity));
$type = uc_words(trim($type));
$name = uc_words(trim($name));
$entity != '' && ($className .= '_' . $entity);
$type != '' && ($className .= '_' . $type);
if ($name != '') {
$className .= '_' . $name;
}
$object = new $className($params, $accountModel);
return $object;
}
开发者ID:ppkowalski,项目名称:M2E,代码行数:24,代码来源:Dispatcher.php
注:本文中的uc_words函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论