-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve aliased containers inspecting
- Loading branch information
Kamil
committed
Sep 19, 2024
1 parent
bd7f8fa
commit 7d6dcf6
Showing
5 changed files
with
63 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace KingfisherDirect\BetterDebugHints\Plugin\View; | ||
|
||
use Magento\Framework\View\Element\AbstractBlock; | ||
|
||
class AliasHints | ||
{ | ||
public function aroundGetChildHtml(AbstractBlock $block, \Closure $proceed, string $alias = '', $useCache = true) | ||
{ | ||
$html = $proceed($alias, $useCache); | ||
|
||
if (!$alias || !$html) { | ||
return $html; | ||
} | ||
|
||
$layout = $block->getLayout(); | ||
$name = $block->getNameInLayout(); | ||
$childName = $layout->getChildName($name, $alias); | ||
|
||
return | ||
"<script type='text/mage-debug' data-mage-debug-position='start' data-mage-debug='$childName'></script>". | ||
$html. | ||
"<script type='text/mage-debug' data-mage-debug-position='end' data-mage-debug='$childName'></script>"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters