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


PHP Convert::urlWord方法代码示例

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


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

示例1: guncelle

 public function guncelle($id, $data)
 {
     $ekle = DB::where('id=', $id)->update('haberler', ['sef' => Convert::urlWord($data["baslik"]), 'baslik' => $data["baslik"], 'resim' => $data["resim"], 'detay' => $data["detay"], 'etiketler' => $data["etiketler"], 'durum' => $data["durum"]]);
     if ($ekle) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:9,代码来源:haberler.php

示例2: start

 public function start($fileName = 'upload', $rootDir = UPLOADS_DIR)
 {
     if (isset($this->settings['source'])) {
         $fileName = $this->settings['source'];
     }
     if (isset($this->settings['target'])) {
         $rootDir = $this->settings['target'];
     }
     if (!is_string($fileName)) {
         return Error::set(lang('Error', 'stringParameter', 'fileName'));
     }
     if (!is_string($rootDir)) {
         $rootDir = UPLOADS_DIR;
     }
     // Dosya yükleme ayarları yapılmamışsa
     // Varsayılan ayarları kullanması için.
     if ($this->settingStatus === false) {
         $this->settings();
     }
     $this->file = $fileName;
     $root = $rootDir;
     if (!isset($_FILES[$fileName]['name'])) {
         $this->manuelError = 4;
         return false;
     }
     $name = $_FILES[$fileName]['name'];
     $encryption = '';
     if (isset($this->settings['prefix'])) {
         $encryption = $this->settings['prefix'];
     }
     if (isset($this->settings['extensions'])) {
         $extensions = explode("|", $this->settings['extensions']);
     }
     $source = $_FILES[$fileName]['tmp_name'];
     // Çoklu yükleme yapılıyorsa.
     if (is_array($name)) {
         if (empty($name[0])) {
             $this->manuelError = 4;
             return false;
         }
         for ($index = 0; $index < count($name); $index++) {
             $src = $source[$index];
             $nm = $name[$index];
             if ($this->settings['encryption']) {
                 if (!isset($this->settings['prefix'])) {
                     $encryption = substr(Encode::type(uniqid(rand()), $this->settings['encryption']), 0, $this->settings['encodeLength']) . '-';
                 }
             }
             if ($this->settings['convertName'] === true) {
                 $nm = Convert::urlWord($nm);
             }
             $target = $root . '/' . $encryption . $nm;
             if (isset($this->settings['extensions']) && !in_array(extension($nm), $extensions)) {
                 $this->extensionControl = lang('Upload', 'extensionError');
             } elseif (isset($this->settings['maxsize']) && $this->settings['maxsize'] < filesize($src)) {
                 $this->manuelError = 10;
             } else {
                 if (!is_file($rootDir)) {
                     move_uploaded_file($src, $target);
                 } else {
                     $this->manuelError = 9;
                 }
             }
         }
     } else {
         if ($this->settings['encryption']) {
             if (!isset($this->settings['prefix'])) {
                 $encryption = substr(Encode::type(uniqid(rand()), $this->settings['encryption']), 0, $this->settings['encodeLength']) . '-';
             }
         }
         if ($this->settings['convertName'] === true) {
             $name = Convert::urlWord($name);
         }
         if (empty($_FILES[$fileName]['name'])) {
             $this->manuelError = 4;
             return false;
         }
         if (isset($this->settings['maxsize']) && $this->settings['maxsize'] < filesize($source)) {
             $this->manuelError = 10;
             return false;
         }
         $target = $root . '/' . $encryption . $name;
         $this->encodeName = $encryption . $name;
         if (isset($this->settings['extensions']) && !in_array(extension($name), $extensions)) {
             $this->extensionControl = lang('Upload', 'extensionError');
         } else {
             if (!is_file($rootDir)) {
                 move_uploaded_file($source, $target);
             } else {
                 $this->manuelError = 9;
             }
         }
     }
 }
开发者ID:erdidoqan,项目名称:znframework,代码行数:94,代码来源:Upload.php


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