本文整理匯總了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('[]' => '', '-' => '_'));
}
示例2: testMakeFriendlyOmitMaxLength
public function testMakeFriendlyOmitMaxLength()
{
$this->assertEquals('tests-of-dashes-and-under_scores', fURL::makeFriendly('tests of dashes - and under_scores', '-'));
}
示例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
*/