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


PHP TextHelper::camelcase方法代码示例

本文整理汇总了PHP中TextHelper::camelcase方法的典型用法代码示例。如果您正苦于以下问题:PHP TextHelper::camelcase方法的具体用法?PHP TextHelper::camelcase怎么用?PHP TextHelper::camelcase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextHelper的用法示例。


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

示例1: displayTableGrid

 protected function displayTableGrid($rows = 3, $columns = 3, $c = NULL)
 {
     if (!$c) {
         global $c;
     }
     if ($c->isEditMode()) {
         $editMode = 'ccm-edit-mode';
     }
     if (!intval($rows)) {
         $rows = 1;
     }
     if (!intval($columns)) {
         $columns = 3;
     }
     $layoutNameClass = 'ccm-layout-name-' . TextHelper::camelcase($this->getAreaHandle()) . '-' . TextHelper::camelcase($this->getLayoutNameTxt()) . '-' . $this->getAreaNameNumber();
     echo '<div id="ccm-layout-' . $this->layoutID . '" class="ccm-layout ccm-layout-table  ' . $layoutNameClass . ' ' . $editMode . '">';
     for ($i = 0; $i < $rows; $i++) {
         echo '<div class="ccm-layout-row ccm-layout-row-' . ($i + 1) . '">';
         $cumulativeWidth = 0;
         for ($j = 0; $j < $columns; $j++) {
             $colWidth = $columns == 1 ? '100%' : $this->getNextColWidth($j, $cumulativeWidth);
             $cumulativeWidth += intval(str_replace(array('px', '%'), '', strtolower($colWidth)));
             $columnn_id = 'ccm-layout-' . intval($this->layoutID) . '-col-' . ($j + 1);
             if ($j == 0) {
                 $positionTag = 'first';
             } elseif ($j == $columns - 1) {
                 $positionTag = 'last';
             } else {
                 $positionTag = '';
             }
             echo '<div class="' . $columnn_id . ' ccm-layout-cell ccm-layout-col ccm-layout-col-' . ($j + 1) . ' ' . $positionTag . '" style="width:' . $colWidth . '">';
             $a = new Area($this->getCellAreaHandle($this->getCellNumber()));
             ob_start();
             $a->display($c);
             $areaHTML = ob_get_contents();
             ob_end_clean();
             if (strlen($areaHTML)) {
                 if (intval($this->spacing)) {
                     $areaHTML = '<div class="ccm-layout-col-spacing">' . $areaHTML . '</div>';
                 }
                 echo $areaHTML;
             } else {
                 echo '&nbsp;';
             }
             echo '</div>';
         }
         echo '<div class="ccm-spacer"></div>';
         echo '</div>';
     }
     echo '</div>';
 }
开发者ID:homer6,项目名称:concrete5-mirror,代码行数:51,代码来源:layout.php

示例2: outputCustomStyleHeaderItems

	/** 
	 * Retrieves all custom style rules that should be inserted into the header on a page, whether they are defined in areas
	 * or blocks
	 */
	public function outputCustomStyleHeaderItems($return = false) {	
		
		$db = Loader::db();
		$csrs = array();
		$txt = Loader::helper('text');
		CacheLocal::set('csrCheck', $this->getCollectionID() . ':' . $this->getVersionID(), true);

		$r1 = $db->GetAll('select bID, arHandle, csrID from CollectionVersionBlockStyles where cID = ? and cvID = ? and csrID > 0', array($this->getCollectionID(), $this->getVersionID()));
		$r2 = $db->GetAll('select arHandle, csrID from CollectionVersionAreaStyles where cID = ? and cvID = ? and csrID > 0', array($this->getCollectionID(), $this->getVersionID()));
		foreach($r1 as $r) {
			$csrID = $r['csrID'];
			$arHandle = $txt->filterNonAlphaNum($r['arHandle']);
			$bID = $r['bID'];
			$obj = CustomStyleRule::getByID($csrID);
			if (is_object($obj)) {
				$obj->setCustomStyleNameSpace('blockStyle' . $bID . $arHandle);
				$csrs[] = $obj;
				CacheLocal::set('csrObject', $this->getCollectionID(). ':' . $this->getVersionID() . ':' . $r['arHandle']  . ':' . $r['bID'], $obj);
			}
		}

		foreach($r2 as $r) {
			$csrID = $r['csrID'];
			$arHandle = $txt->filterNonAlphaNum($r['arHandle']);
			$obj = CustomStyleRule::getByID($csrID);
			if (is_object($obj)) {
				$obj->setCustomStyleNameSpace('areaStyle' . $arHandle);
				$csrs[] = $obj;
				CacheLocal::set('csrObject', $this->getCollectionID(). ':' . $this->getVersionID() . ':' . $r['arHandle'], $obj);
			}
		}
		
		// grab all the header block style rules for items in global areas on this page
		$rs = $db->GetCol('select arHandle from Areas where arIsGlobal = 1 and cID = ?', array($this->getCollectionID()));
		if (count($rs) > 0) {
			$pcp = new Permissions($this);
			foreach($rs as $garHandle) {
				if ($pcp->canViewPageVersions()) {
					$s = Stack::getByName($garHandle, 'RECENT');
				} else {
					$s = Stack::getByName($garHandle, 'ACTIVE');
				}
				if (is_object($s)) {
					CacheLocal::set('csrCheck', $s->getCollectionID() . ':' . $s->getVersionID(), true);
					$rs1 = $db->GetAll('select bID, csrID, arHandle from CollectionVersionBlockStyles where cID = ? and cvID = ? and csrID > 0', array($s->getCollectionID(), $s->getVersionID()));
					foreach($rs1 as $r) {
						$csrID = $r['csrID'];
						$arHandle = $txt->filterNonAlphaNum($r['arHandle']);
						$bID = $r['bID'];
						$obj = CustomStyleRule::getByID($csrID);
						if (is_object($obj)) {
							$obj->setCustomStyleNameSpace('blockStyle' . $bID . $arHandle);
							$csrs[] = $obj;
							CacheLocal::set('csrObject', $s->getCollectionID(). ':' . $s->getVersionID() . ':' . $r['arHandle'] . ':' . $r['bID'], $obj);
						}
					}
				}
			}
		}
		//get the header style rules
		$styleHeader = ''; 
		foreach($csrs as $st) { 
			if ($st->getCustomStyleRuleCSSID(true)) { 
				$styleHeader .= '#'.$st->getCustomStyleRuleCSSID(1).' {'. $st->getCustomStyleRuleText(). "} \r\n";  
			}
		} 		
		  
		$r3 = $db->GetAll('select l.layoutID, l.spacing, arHandle, areaNameNumber from CollectionVersionAreaLayouts cval LEFT JOIN Layouts AS l ON  cval.layoutID=l.layoutID WHERE cval.cID = ? and cval.cvID = ?', array($this->getCollectionID(), $this->getVersionID()));
		foreach($r3 as $data){  
			if(!intval($data['spacing'])) continue; 
			$layoutIDVal = strtolower('ccm-layout-'.TextHelper::camelcase($data['arHandle']).'-'.$data['layoutID'] . '-'. $data['areaNameNumber']);
			$layoutStyleRules='#' . $layoutIDVal . ' .ccm-layout-col-spacing { margin:0px '.ceil(floatval($data['spacing'])/2).'px }';
			$styleHeader .= $layoutStyleRules . " \r\n";  
		}  
		
		if(strlen(trim($styleHeader))) {
			if ($return == true) {
				return $styleHeader;
			} else {
				$v = View::getInstance();
				$v->addHeaderItem("<style type=\"text/css\"> \r\n".$styleHeader.'</style>', 'VIEW');
			}
		}
	} 
开发者ID:ronlobo,项目名称:concrete5,代码行数:88,代码来源:collection.php


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