Skip to content

Commit

Permalink
Add syntax highlighting for code samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Igloczek authored Sep 2, 2021
1 parent 7902b4f commit bbc4c4a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Your template files must have the file extension `.twig` to get automatically re

In your layout xml files or blocks please specify the new template

```
```xml
<referenceBlock name="top.links">
<block class="Magento\Theme\Block\Html\Header" template="html/header.twig" name="header" as="header" before="-">
<arguments>
Expand All @@ -59,7 +59,7 @@ In your layout xml files or blocks please specify the new template

#### Example header.phtml converted to header.twig

```
```php
<?php switch ($this->getShowPart()):
case 'welcome': ?>
<li class="greet welcome"><?php echo $this->getWelcome() ?></li>
Expand All @@ -70,7 +70,7 @@ In your layout xml files or blocks please specify the new template
<?php endswitch; ?>
```

```
```twig
{% if getShowPart() == 'welcome' %}
<li class="greet welcome">{{ getWelcome() }}</li>
{% endif %}
Expand All @@ -82,7 +82,7 @@ In your layout xml files or blocks please specify the new template

#### Example breadcrumbs.phtml converted to breadcrumbs.twig

```
```php
<?php if ($crumbs && is_array($crumbs)) : ?>
<div class="breadcrumbs">
<ul class="items">
Expand All @@ -104,7 +104,7 @@ In your layout xml files or blocks please specify the new template
<?php endif; ?>
```

```
```twig
{% if crumbs %}
<div class="breadcrumbs">
<ul class="items">
Expand All @@ -130,7 +130,7 @@ In your layout xml files or blocks please specify the new template

Write in your `.twig` file:

```
```twig
{{ helper("Magento\\Core\\Helper\\Url").getHomeUrl() }}
```

Expand Down

0 comments on commit bbc4c4a

Please sign in to comment.