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


PHP FabrikString::ltrim方法代码示例

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


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

示例1: setRowClass

 /**
  * Set row class
  *
  * @param   array  &$data  row data to set class for
  *
  * @return  null
  */
 public function setRowClass(&$data)
 {
     $rowclass = $this->getParams()->get('use_as_row_class');
     if ($rowclass == 1) {
         $col = $this->getFullName(false, true, false);
         $rawcol = $col . '_raw';
         foreach ($data as $groupk => $group) {
             for ($i = 0; $i < count($group); $i++) {
                 $c = false;
                 if (isset($data[$groupk][$i]->data->{$rawcol})) {
                     $c = $data[$groupk][$i]->data->{$rawcol};
                 } elseif (isset($data[$groupk][$i]->data->{$col})) {
                     $c = $data[$groupk][$i]->data->{$col};
                 }
                 if ($c !== false) {
                     $c = preg_replace('/[^A-Z|a-z|0-9]/', '-', $c);
                     $c = FabrikString::ltrim($c, '-');
                     $c = FabrikString::rtrim($c, '-');
                     // $$$ rob 24/02/2011 can't have numeric class names so prefix with element name
                     if (is_numeric($c)) {
                         $c = $this->getElement()->name . $c;
                     }
                     $data[$groupk][$i]->class .= ' ' . $c;
                 }
             }
         }
     }
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:35,代码来源:element.php

示例2: deleteFile

 /**
  * Delete the file
  *
  * @param   string $filename Path to file (not including JPATH)
  *
  * @return  void
  */
 protected function deleteFile($filename)
 {
     if (empty($filename)) {
         return;
     }
     $storage = $this->getStorage();
     $file = $storage->clean(JPATH_SITE . '/' . $filename);
     $thumb = $storage->clean(JPATH_SITE . '/' . $storage->_getThumb($filename));
     $cropped = $storage->clean(JPATH_SITE . '/' . $storage->_getCropped($filename));
     $logMsg = 'Delete files: ' . $file . ' , ' . $thumb . ', ' . $cropped . '; user = ' . $this->user->get('id');
     JLog::add($logMsg, JLog::WARNING, 'com_fabrik.element.fileupload');
     if ($storage->exists($file)) {
         $storage->delete($file);
     }
     if ($storage->exists($thumb)) {
         $storage->delete($thumb);
     } else {
         if ($storage->exists(JPATH_SITE . '/' . FabrikString::ltrim($thumb, '/'))) {
             $storage->delete(JPATH_SITE . '/' . FabrikString::ltrim($thumb, '/'));
         }
     }
     if ($storage->exists($cropped)) {
         $storage->delete($cropped);
     } else {
         if ($storage->exists(JPATH_SITE . '/' . FabrikString::ltrim($cropped, '/'))) {
             $storage->delete(JPATH_SITE . '/' . FabrikString::ltrim($cropped, '/'));
         }
     }
 }
开发者ID:bauer-git,项目名称:fabrik-1,代码行数:36,代码来源:fileupload.php


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