Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
404.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <header class="header">
11  <img class="logo" src="<?= $this->basePath() ?>/pub/images/magento-icon.svg" alt="Magento"/>
12  <h1 class="header-title">A 404 error occurred</h1>
13 </header>
14 
15 <h2>Page not found</h2>
16 
17 <?php if ( isset( $this->reason ) && $this->reason ): ?>
18 
19  <?php
20  $reasonMessage = '';
21  switch ( $this->reason ) {
22  case 'error-controller-cannot-dispatch':
23  $reasonMessage = 'The requested controller was unable to dispatch the request.';
24  break;
25  case 'error-controller-not-found':
26  $reasonMessage = 'The requested controller could not be mapped to an existing controller class.';
27  break;
28  case 'error-controller-invalid':
29  $reasonMessage = 'The requested controller was not dispatchable.';
30  break;
31  case 'error-router-no-match':
32  $reasonMessage = 'The requested URL could not be matched by routing.';
33  break;
34  default:
35  $reasonMessage = 'We cannot determine at this time why a 404 was generated.';
36  break;
37  }
38  ?>
39 
40  <p><?= $reasonMessage ?></p>
41 
42 <?php endif ?>
43 
44 <?php if ( isset( $this->controller ) && $this->controller ): ?>
45 
46  <dl>
47  <dt>Controller:</dt>
48  <dd><?= $this->escapeHtml( $this->controller ) ?>
49  <?php
50  if ( isset( $this->controller_class )
51  && $this->controller_class
52  && $this->controller_class != $this->controller
53  ) {
54  echo '(' . sprintf( 'resolves to %s', $this->escapeHtml( $this->controller_class ) ) . ')';
55  }
56  ?>
57  </dd>
58  </dl>
59 
60 <?php endif ?>
61 
62 <?php if ( isset( $this->display_exceptions ) && $this->display_exceptions ): ?>
63 
64  <?php if ( isset( $this->exception ) && $this->exception instanceof Exception ): ?>
65  <hr/>
66  <h2>Additional information:</h2>
67  <h3><?= get_class( $this->exception ) ?></h3>
68  <dl>
69  <dt>File:</dt>
70  <dd>
71  <pre class="prettyprint linenums"><?= $this->exception->getFile() ?>:<?= $this->exception->getLine() ?></pre>
72  </dd>
73 
74  <dt>Message:</dt>
75  <dd>
76  <pre class="prettyprint linenums"><?= $this->exception->getMessage() ?></pre>
77  </dd>
78 
79  <dt>Stack trace:</dt>
80  <dd>
81  <pre class="prettyprint linenums"><?= $this->exception->getTraceAsString() ?></pre>
82  </dd>
83  </dl>
84  <?php
85  $e = $this->exception->getPrevious();
86  if ( $e ) :
87  ?>
88  <hr/>
89  <h2>Previous exceptions:</h2>
90  <ul class="unstyled">
91  <?php while ( $e ) : ?>
92  <li>
93  <h3><?= get_class( $e ) ?></h3>
94  <dl>
95  <dt>File:</dt>
96  <dd>
97  <pre class="prettyprint linenums"><?= $e->getFile() ?>:<?= $e->getLine() ?></pre>
98  </dd>
99 
100  <dt>Message:</dt>
101  <dd>
102  <pre class="prettyprint linenums"><?= $e->getMessage() ?></pre>
103  </dd>
104 
105  <dt>Stack trace:</dt>
106  <dd>
107  <pre class="prettyprint linenums"><?= $e->getTraceAsString() ?></pre>
108  </dd>
109  </dl>
110  </li>
111  <?php
112  $e = $e->getPrevious();
114  ?>
115  </ul>
116  <?php endif; ?>
117 
118  <?php else: ?>
119 
120  <p>No Exception available</p>
121 
122  <?php endif ?>
123 
124 <?php endif ?>
endif
Definition: 404.phtml:116
endwhile
Definition: 404.phtml:113