Web Analytics

Fill the form & Get Installation Support

    How to get list of Layout XML called for a current page in Magento 2

    You can get a list of called Layout XML for specific pages by Magento\Framework\App\View class.

    Call getLayout() method from Magento\Framework\App\View.php class.

    getLayout()->getUpdate()->getHandles() is used for getting all the handles of a page.

    You need to add the following code at the end of root index.php file to check XML files.

    To check for a specific page, You need to call the function as below:

    Call Inside a function,
    $loadedHandles = $this->view->getLayout()->getUpdate()->getHandles();

    Now you can print the result $loadedHandles from above expression.

    Fill the below form if you have any Magento programming need.

      Recent Articles

      Author Info

      Hire B. Darji

      Get a Free Quote

        Connect With Us