getAddonLogo( )获取应用LOGO

/**
* @param string $name 应用标识
* @param $logoName
*/

function getAddonLogo($name = '')
{
if ($name == '') {
return false;
}
$model = new \app\common\model\Addons();
$info = $model->getAddonByFile($name);
$loginFile= ROOT_PATH. '/addons/' . $name . '/' . $info['logo'];
if(is_file($loginFile)){
if($fp = fopen($loginFile,"rb", 0))
{
$gambar = fread($fp,filesize($loginFile));
fclose($fp);
$base64 = chunk_split(base64_encode($gambar));
return $encode = 'data:image/jpg/png/gif;base64,' . $base64 ;
}
}
}

0 个评论

要回复文章请先登录注册