I am accessing block function in phtml like
$blockObj= $block->getLayout()->createBlock('Esparksinc\Extension\Block\Product\View');
but this gave Waring of class notation instead while cheqing code during coding standarded.
Use
$blockObj= $block->getLayout()->createBlock(\Esparksinc\Extension\Block\Product\View::class);
instead of
$blockObj= $block->getLayout()->createBlock('Esparksinc\Extension\Block\Product\View');
Or, Add this block using layout.
.phtml file. Any idea?
phtml file as well.
\Esparksinc\Extension\Block\Product\View::class .Double ::
()`
Bacically block is attached with its phtml so we can directly call block function from phtml so there is no need to create the block object at all like.
$block->callBlockFunction();