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


PHP Helper::clean_string方法代码示例

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


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

示例1: _getCategoryLink

 function _getCategoryLink($catName)
 {
     $catName = Helper::clean_string($catName);
     $pageNumber = 1;
     return $this->getCategoryLink('category', $catName, $pageNumber);
     //see CategoryLink trait
 }
开发者ID:phn007,项目名称:MyTools,代码行数:7,代码来源:ClsProductList.php

示例2: addBrandLinkIntoProductItem

 function addBrandLinkIntoProductItem($productItem)
 {
     $filename = Helper::clean_string($productItem['brand']);
     $productItem['brandLink'] = $this->getCategoryLink('brand', $filename);
     //permalink trait
     return $productItem;
 }
开发者ID:phn007,项目名称:BuildHtml,代码行数:7,代码来源:productDetail_trait.php

示例3: getCatLink

 function getCatLink($item, $catType)
 {
     if ($catType == 'Category') {
         $link = $this->getCategoryLink('brand', Helper::clean_string($item['brand']), 1);
         return '<a title="' . $item['brand'] . '" href="' . $link . '">' . $item['brand'] . '</a>';
     }
     if ($catType == 'Brand') {
         $link = $this->getCategoryLink('category', Helper::clean_string($item['category']), 1);
         return '<a title="' . $item['category'] . '" href="' . $link . '">' . $item['category'] . '</a>';
     }
 }
开发者ID:phn007,项目名称:MyTools,代码行数:11,代码来源:index.php

示例4: getCatLink

 function getCatLink($item)
 {
     if ($this->catType == 'Category') {
         $link = HOME_URL . 'brand/' . Helper::clean_string($item['brand']) . FORMAT;
         return '<a title="' . $item['brand'] . '" href="' . $link . '">' . $item['brand'] . '</a>';
     }
     if ($this->catType == 'Brand') {
         $link = HOME_URL . 'category/' . Helper::clean_string($item['category']) . FORMAT;
         return '<a title="' . $item['category'] . '" href="' . $link . '">' . $item['category'] . '</a>';
     }
 }
开发者ID:phn007,项目名称:BuildHtml,代码行数:11,代码来源:categoryListItems.php

示例5: update

 public function update()
 {
     $json = $this->run();
     if ($json->updated == 'YES') {
         $name = $json->_id;
         $city = Helper::clean_string($json->city);
         $state = strtolower($json->state_code);
         $url = Env::cinema_url() . $state . '/' . $city . '/' . $name;
         //retorna a url para acesso e o status assim o cliente pode testar o status antes de fazer uma requisicao.
         $cinema = new stdClass();
         $cinema->url = $url;
         $cinema->status = $json->status;
         return $cinema;
     }
 }
开发者ID:xxdf,项目名称:showtimes,代码行数:15,代码来源:AbstractCinemaAdapter.php

示例6: getBrandLink

 function getBrandLink($brand)
 {
     //echo HOME_URL . 'brand/' . Helper::clean_string( $brand ) . FORMAT;
     echo $this->getCategoryLink('brand', Helper::clean_string($brand), 1);
 }
开发者ID:phn007,项目名称:MyTools,代码行数:5,代码来源:index.php

示例7: getBrandLink

 function getBrandLink($brand)
 {
     echo HOME_URL . 'brand/' . Helper::clean_string($brand) . FORMAT;
 }
开发者ID:phn007,项目名称:BuildHtml,代码行数:4,代码来源:relatedProductItems.php

示例8: getCategorySlug

 function getCategorySlug()
 {
     return Helper::clean_string($this->productDetail['category']);
 }
开发者ID:phn007,项目名称:BuildHtml,代码行数:4,代码来源:relatedProducts_trait.php

示例9: getCategoryLink

 function getCategoryLink($catName)
 {
     $catName = Helper::clean_string($catName);
     return HOME_URL . 'cat/' . $catName . FORMAT;
 }
开发者ID:phn007,项目名称:BuildHtml,代码行数:5,代码来源:productList.php

示例10: _getCategoryLink

 function _getCategoryLink($catName)
 {
     $catName = Helper::clean_string($catName);
     return $this->getCategoryLink('category', $catName) . FORMAT;
     //see CategoryLink trait
 }
开发者ID:phn007,项目名称:BuildHtml,代码行数:6,代码来源:ClsProductList.php

示例11: notify_invalid_cinemas

 private function notify_invalid_cinemas()
 {
     if (count($this->_cinemas) == 0) {
         Log::write("Não achou cinemas para " . $this->_state);
         return;
     }
     $invalid = array_filter($this->_cinemas, function ($var) {
         return empty($var->id) || empty($var->address);
     });
     $cinemas = array();
     foreach ($invalid as $key => $value) {
         $uf = Helper::clean_string($value->state_code);
         $cidade = Helper::clean_string($value->city);
         $nome = Helper::clean_string($value->name);
         $cinema = "{$uf}/{$cidade}/{$nome}";
         $cinemas[] = $cinema;
     }
     Sendmail::to_admin("Cinemas Incompletos", $cinemas);
 }
开发者ID:xxdf,项目名称:showtimes,代码行数:19,代码来源:CinemaFinder.php

示例12: xtest_clean_string

 function xtest_clean_string()
 {
     echo Helper::clean_string('São Paulo');
 }
开发者ID:xxdf,项目名称:showtimes,代码行数:4,代码来源:BasicTest.php

示例13: categoryLink

 function categoryLink($catName)
 {
     $catName = Helper::clean_string($catName);
     return $this->getCategoryLink('category', $catName, 1);
 }
开发者ID:phn007,项目名称:MyTools,代码行数:5,代码来源:index.php

示例14: new_template

 private function new_template($dir, Cinema $cinema)
 {
     $nome = $cinema->name;
     $class = Helper::clean_string($nome, -1, '_');
     $file = $class . '.php';
     $tid = $cinema->id;
     //se ja tem uma classe para o cinema descarta entao
     //pesquisa classe com mesmo nome recursivo a partir do diretorio do estado...
     if (!Helper::recursive_file_exists($file, $dir)) {
         $temp_uf = $cinema->state_code;
         $cinema = $this->geo_cinema($cinema);
         $endereco = $cinema->address;
         $telefone = $cinema->phone;
         $url = $cinema->url;
         $lat = $cinema->lat;
         $long = $cinema->long;
         $cidade = $cinema->city;
         $estado = $cinema->state;
         $uf = $cinema->state_code;
         //esse if deve evitar o compartamente do google de procurar cinemas proximos tipo colocar volta redonda dentro de sp
         if (empty($uf)) {
             //se caiu aqui é pq o geocode do endereco do cine falhou entao usa a uf temp pelo menos para colocar o cine no dir correto
             $uf = $temp_uf;
             $path = $dir . $uf . '/';
         } else {
             //bug do google maps
             if (Helper::clean_string($uf) == 'sao-paulo') {
                 $uf = 'SP';
             }
             $path = $dir . $uf . '/' . Helper::clean_string($cinema->city);
         }
         $path = strtolower($path);
         $this->create_dir($path);
         $tpl = Env::path('helper/CinemaClass.tpl');
         if (!is_file($tpl)) {
             Log::write("Não achou {$tpl}");
             exit(1);
         }
         //a classe do cinema fica sempre em cinema/uf/cidade/file.php
         $file = $path . '/' . $file;
         $handle = fopen($file, 'w');
         if ($handle == false) {
             Log::write("Erro criando {$file}");
             exit(1);
         }
         $cinema_class = file_get_contents($tpl);
         $content = str_replace("%class", $class, $cinema_class);
         $content = str_replace("%nome", $nome, $content);
         $content = str_replace("%id", $tid, $content);
         $content = str_replace("%endereco", $endereco, $content);
         $content = str_replace("%telefone", $telefone, $content);
         $content = str_replace("%cidade", $cidade, $content);
         $content = str_replace("%estado", $estado, $content);
         $content = str_replace("%uf", $uf, $content);
         $content = str_replace("%lat", $lat, $content);
         $content = str_replace("%long", $long, $content);
         $content = str_replace("%url", $url, $content);
         fwrite($handle, $content);
         fclose($handle);
         //guarda todos os novos cinemas criados para depois notificar via email para o admin controlar...
         //se não achou a cidade do cinema via geolocation vai colocar em um lugar errado, entao tem q notificar...
         $cinema_path = str_replace(Env::path(), "", $file);
         if (empty($cidade)) {
             $this->invalid_cinemas[] = $cinema_path;
         } else {
             $this->new_cinemas[] = $cinema_path;
         }
     }
 }
开发者ID:xxdf,项目名称:showtimes,代码行数:69,代码来源:CinemaTemplate.php


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