Created
August 9, 2020 12:51
-
-
Save tobyontour/dc3fef82fa0c0c0c6d2c7380829be660 to your computer and use it in GitHub Desktop.
Drupal index.php to spit out route name.
This file contains hidden or 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
| <?php | |
| /** | |
| * @file | |
| * The PHP page that serves all page requests on a Drupal installation. | |
| * | |
| * All Drupal code is released under the GNU General Public License. | |
| * See COPYRIGHT.txt and LICENSE.txt files in the "core" directory. | |
| */ | |
| use Drupal\Core\DrupalKernel; | |
| use Symfony\Component\HttpFoundation\Request; | |
| $autoloader = require_once 'autoload.php'; | |
| $kernel = new DrupalKernel('prod', $autoloader); | |
| $request = Request::createFromGlobals(); | |
| $response = $kernel->handle($request); | |
| error_log(\Drupal::routeMatch()->getRouteName()); | |
| $response->send(); | |
| $kernel->terminate($request, $response); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment