Skip to main content
Improve formatting and wording
Source Link
Daniel
  • 2.3k
  • 1
  • 19
  • 38

layoutLayout file: So if

<block class="Magento\NegotiableQuote\Block\Quote\Info" name="quote.status" template="Magento_NegotiableQuote::quote/status.phtml"/> 

So you can use: $blockname = $block->getNameInLayout() //for$blockname = $block->getNameInLayout() for fetching the "name" assigned to the block in layout file.e, e.g commentcomment.status.status

OR

Use: var_dump(get_class($block));Or you can use //var_dump(get_class($block)); to fetch the class of the block.

layout file: So if use: $blockname = $block->getNameInLayout() //for fetching the "name" assigned to the block in layout file.e.g comment.status

OR

Use: var_dump(get_class($block)); // to fetch the class of the block

Layout file:

<block class="Magento\NegotiableQuote\Block\Quote\Info" name="quote.status" template="Magento_NegotiableQuote::quote/status.phtml"/> 

So you can use $blockname = $block->getNameInLayout() for fetching the "name" assigned to the block in layout file, e.g comment.status.

Or you can use var_dump(get_class($block)); to fetch the class of the block.

Source Link

layout file: So if use: $blockname = $block->getNameInLayout() //for fetching the "name" assigned to the block in layout file.e.g comment.status

OR

Use: var_dump(get_class($block)); // to fetch the class of the block