cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 extention:how phtml integrate with class and admin view?

Magento 2 extention:how phtml integrate with class and admin view?

i have phtml file and i declare in the Block\login.php as $_template = "phtml path",
its working fine but not for MEQP2 its giving WARNING | Property name "$_template" should not be prefixed with an underscore to indicate visibility;
when i remove the underscore with veriable of $template then magento view is not working. i already use the upgrade:setup command but not working fine. then what i do?

1 REPLY 1

Re: Magento 2 extention:how phtml integrate with class and admin view?

Hi @Rizwan407,

 

It seems you're using the right variable: https://github.com/magento/magento2/blob/2.2-develop/lib/internal/Magento/Framework/View/Element/Tem...

 

Maybe you can try using layout files to set the template?