fix photo module

This commit is contained in:
2024-11-29 14:07:55 +03:00
parent 3ef1e7d7e0
commit 0ed97877fd
3 changed files with 46 additions and 1 deletions

30
kernel/helpers/Html.php Normal file
View File

@ -0,0 +1,30 @@
<?php
namespace kernel\helpers;
class Html
{
public static function img(string $src, array $params = [])
{
$paramsStr = self::createParams($params);
return "<img src='$src' $paramsStr>";
}
/**
* @param array $data
* @return string
*/
public static function createParams(array $data = []): string
{
$paramsString = "";
foreach($data as $key => $param){
if(is_string($param)){
$paramsString .= $key . "='" . $param . "'";
}
}
return $paramsString;
}
}