Right Now I am working on a custom MVC Application in PHP and I was confused where to include several simple common functions in my application. Functions such as truncateString() and to check if multiple strings are empty such as:
function truncateString($string, $length, $addDots = true) {
$str = substr($string, 0, $length);
if($addDots == true && (strlen($string) > $length)) {
$str .= "...";
}
return $str;
}
This is my folder structure:
Should I have a seperate file or a class for functions? Or should i have it in helpers?
question from:https://stackoverflow.com/questions/65907292/place-for-common-functions-in-mvc-php