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


PHP fURL::makeFriendly方法代碼示例

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


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

示例1: _simplify

 /**
  * Can be used to convert strings such as textual labels into simpler strings suitable for use as an HTML statement's id.
  **/
 public static function _simplify($name)
 {
     //$o = wire()->sanitizer->pageName($name, true);
     $o = fURL::makeFriendly($name);
     return strtr($o, array('[]' => '', '-' => '_'));
 }
開發者ID:netcarver,項目名稱:fxForm,代碼行數:9,代碼來源:fxForm.php

示例2: testMakeFriendlyOmitMaxLength

 public function testMakeFriendlyOmitMaxLength()
 {
     $this->assertEquals('tests-of-dashes-and-under_scores', fURL::makeFriendly('tests of dashes - and under_scores', '-'));
 }
開發者ID:nurulimamnotes,項目名稱:flourish-old,代碼行數:4,代碼來源:fURLTest.php

示例3: fUpload

 * Limited By User Permissions
 */
/*
 * Add Files to Server
 */
if (!empty($_FILES)) {
    $uploader = new fUpload();
    $uploader->setOptional();
    $uploader->setMIMETypes($acceptedFiles, 'El tipo de archivo es incorrecto');
    $dir = 'uploads/banner/';
    $dir2 = 'uploads/banner/thumbs/';
    $imageDescrip = fRequest::encode('imageDescrip');
    $uploaded = fUpload::count('files');
    for ($i = 0; $i < $uploaded; $i++) {
        $ext = strtolower(pathinfo($_FILES['files']['name'][$i], PATHINFO_EXTENSION));
        $_FILES['files']['name'][$i] = fURL::makeFriendly(str_replace(' ', '-', $_FILES['files']['name'][$i])) . ".{$ext}";
        $uploader->move($dir, 'files', $i);
        $fileName[] = $_FILES['files']['name'][$i];
        $fileType[] = $_FILES['files']['type'][$i];
        copy($dir . $fileName[$i], $dir2 . $fileName[$i]);
        $image3 = new fImage($dir2 . $fileName[$i]);
        $image3->cropToRatio(1, 1, 'left', 'bottom');
        $image3->resize(200, 0);
        $image3->saveChanges();
        /*
        				    $ftp = new ftp($user,$pass);
        $ftp->upload($dir . "/" . $fileName[$i], 'DIR EN REMOTE');
        # resize 
        $ftp->upload($dir2 . "/" . $fileName[$i], 'DIR EN REMOTE');
        $image->delete
        */
開發者ID:nevermind89x,項目名稱:Mi-morelia,代碼行數:31,代碼來源:banner_add.php


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