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


PHP TextHelper::urlize方法代碼示例

本文整理匯總了PHP中TextHelper::urlize方法的典型用法代碼示例。如果您正苦於以下問題:PHP TextHelper::urlize方法的具體用法?PHP TextHelper::urlize怎麽用?PHP TextHelper::urlize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TextHelper的用法示例。


在下文中一共展示了TextHelper::urlize方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getValue

 function getValue($filtered = true)
 {
     $values = explode($this->separator, $this->_value);
     $tags = array();
     foreach ($values as &$value) {
         $value = trim($value);
         if ($value != '') {
             if ($this->_filter && $filtered) {
                 $value = call_user_func($this->_filter, $value, $this->getName());
             }
             $tags[] = $value;
         }
     }
     $ids = array();
     foreach ($tags as $tag) {
         $ds = new TableReader('blog_tag');
         $id = $ds->select('blog_tag_id')->where('tag', $tag)->fetchScalar();
         if (!$id) {
             $writer = new TableWriter('blog_tag');
             $id = $writer->insert(array('tag' => $tag, 'url_tag' => TextHelper::urlize($tag)));
         }
         $ids[] = $id;
     }
     return $ids;
 }
開發者ID:RNKushwaha022,項目名稱:orange-php,代碼行數:25,代碼來源:taglist.input.php

示例2: parse

 static function parse($path, $replacements = array(), &$substitutions = array())
 {
     $path = self::replaceUploadsDir($path);
     $matches1 = array();
     preg_match_all('/{(appd|uploads|public|random|date|root)(?:\\[([0-9a-zA-Z-_]+)\\])?}/', $path, $matches1, PREG_SET_ORDER);
     $matches2 = array();
     $expression = implode('|', array_keys($replacements));
     preg_match_all('/{(' . $expression . ')(?:\\[([0-9a-zA-Z-_]+)\\])?}/', $path, $matches2, PREG_SET_ORDER);
     $matches = array_merge($matches1, $matches2);
     foreach ($matches as $match) {
         if (isset($replacements[$match[1]])) {
             $substitutions[$match[0]] = $replacements[$match[1]];
             if (isset($match[2])) {
                 if (is_numeric($match[2])) {
                     $substitutions[$match[0]] = substr($substitutions[$match[0]], 0, $match[2]);
                 } elseif (is_callable($match[2])) {
                     $substitutions[$match[0]] = call_user_func($match[2], $substitutions[$match[0]]);
                 } elseif ($match[2] == 'url') {
                     $substitutions[$match[0]] = TextHelper::urlize($substitutions[$match[0]]);
                 }
             }
         } else {
             $param = isset($match[2]) ? $match[2] : null;
             $substitutions[$match[0]] = self::replace($match[1], $param);
         }
     }
     return str_replace(array_keys($substitutions), array_values($substitutions), $path);
 }
開發者ID:RNKushwaha022,項目名稱:orange-php,代碼行數:28,代碼來源:path.helper.php

示例3: _putUrlEntry

 function _putUrlEntry($values)
 {
     foreach ($values['cms_page_meta'] as $i => $cms_page_meta) {
         $title = $values['cms_nav_item_name'][$i][0]['name'];
         $this->db->into('cms_page_meta')->where('language_id', $cms_page_meta[0]['language_id'])->where('page_id', $cms_page_meta[0]['page_id'])->update(array('url_entry' => TextHelper::urlize($title), 'title' => $title));
     }
 }
開發者ID:RNKushwaha022,項目名稱:orange-php,代碼行數:7,代碼來源:cmsadmin.utility.php


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