Hello!
I want to automatically transfer to the main, relative to the current context.
I use this code in the header on the view.
$this->registerMetaTag([ 'name' => 'meta', 'http-equiv' => 'refresh', 'content' => "5; $this->context->module->homeUrl", ]); Throws an error with this code ($ this-> context-> module-> homeUrl)
An Error occurred while handling another error: yii\base\ErrorException: Object of class app\...\DefaultController could not be converted to string in C:\....\error.php:15 Stack trace: But when calling this code ($ this-> context-> module-> homeUrl) via var_dump, the string string (7) / admin / is output
What could be the problem? Meta tags do not display a string, but in other places of norms, like a string.
'content' => "5; $this->context->module->homeUrl",this is the 15th line with an error in the fileC:\....\error.php- Nikolaj Sarry