Hi all,
I have this helper function which gets texts from a database to show on the website.
But I wonder if this can be optimized in terms of efficiency.
The getSiteText() function can be called many times on a single page.
Do I really need to call the TextModel every single time, or are there better ways?
PHP Code:
function getSiteText(string $textName): string
{
$textModel = new TextModel();
return $textModel->getText($textName);
}