Is it possible to call getdata() from inside the block class like this? Because as it is now, i get no data from getdata().
class Index extends Template implements BlockInterface
{
protected $_template = "";
public function __construct(Template\Context $context, array $data = [])
{
parent::__construct($context, $data);
if($this->getData('template_layout') == "LPS" )
{
$this->_template = "widget/Image_left.phtml";
}else if($this->getData('template_layout') == "RPS")
{
$this->_template = "widget/Image_right.phtml";
}
else if($this->getData('template_layout') == "RPWS")
{
$this->_template = "widget/Image_right_No_Space.phtml";
}
else if($this->getData('template_layout') == "LPWS")
{
$this->_template = "widget/Image_right_No_Space.phtml";
}else{
$this->_template = "widget/Image_right.phtml";
}
}
}