add webcam to customer create/update

This commit is contained in:
2015-12-30 12:02:26 +01:00
parent 135d64e4c8
commit eb989d5f80
16 changed files with 240 additions and 7 deletions

View File

@@ -47,4 +47,17 @@ class Upload
return $fileName;
}
static function genFileName($extension, $namePostfix = true)
{
$baseName = "image";
$fileName = StringHelper::truncate(Inflector::slug($baseName), 32, '');
if($namePostfix || !$fileName) {
$fileName .= ($fileName ? '-' : '') . substr(uniqid(md5(rand()), true), 0, 10);
}
$fileName .= '.' . $extension;
return $fileName;
}
}