We can use Magento default variables in layout file using
<item name="link" xsi:type="string">{{baseUrl}}</item>
I would like to create one variable in Block File & Use it. Like
protected function _prepareLayout() {
parent::_prepareLayout();
$this->myVar = 'google.com';
return $this;
}
In layout file
<item name="link" xsi:type="string">{{myVar}}</item>
Can i define & access it or i have to manage through Controller file?