本文整理汇总了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
}
示例2: addBrandLinkIntoProductItem
function addBrandLinkIntoProductItem($productItem)
{
$filename = Helper::clean_string($productItem['brand']);
$productItem['brandLink'] = $this->getCategoryLink('brand', $filename);
//permalink trait
return $productItem;
}
示例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>';
}
}
示例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>';
}
}
示例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;
}
}
示例6: getBrandLink
function getBrandLink($brand)
{
//echo HOME_URL . 'brand/' . Helper::clean_string( $brand ) . FORMAT;
echo $this->getCategoryLink('brand', Helper::clean_string($brand), 1);
}
示例7: getBrandLink
function getBrandLink($brand)
{
echo HOME_URL . 'brand/' . Helper::clean_string($brand) . FORMAT;
}
示例8: getCategorySlug
function getCategorySlug()
{
return Helper::clean_string($this->productDetail['category']);
}
示例9: getCategoryLink
function getCategoryLink($catName)
{
$catName = Helper::clean_string($catName);
return HOME_URL . 'cat/' . $catName . FORMAT;
}
示例10: _getCategoryLink
function _getCategoryLink($catName)
{
$catName = Helper::clean_string($catName);
return $this->getCategoryLink('category', $catName) . FORMAT;
//see CategoryLink trait
}
示例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);
}
示例12: xtest_clean_string
function xtest_clean_string()
{
echo Helper::clean_string('São Paulo');
}
示例13: categoryLink
function categoryLink($catName)
{
$catName = Helper::clean_string($catName);
return $this->getCategoryLink('category', $catName, 1);
}
示例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;
}
}
}