本文整理汇总了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
*/