I am translating a website and I need to input $AppUI->_('') to make translation in system admin. But, somehow I can't use it in this function.
What am I doing wrong?
Here is my script and I hope you will help me:
public function BeginCalc()
{
if($this->getActive())
{
echo $AppUI->_('Calculating');
}
else
{
$this->_BeginCalculation();
echo "Calculation has been started";
}
}
And, when I use like this I get error Fatal error: Call to a member function _() on a non-object in. Tried to search in Stackowerflow but answers there haven't helped me in solving the problem.
$AppUI does not exists in this scope. If it's global variable, you need to import it with global keyword.
But i'd rather advise you to make $AppUI object a singleton and reference to it by AppUI::getInstance()->_('Calculating');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With