Commit 80d9f5c8 authored by alexpott's avatar alexpott

Issue #1987892 by disasm: Convert url_alter_test_foo() to a new style controller.

parent aafee284
<?php
/**
* @file
* Contains \Drupal\url_alter_test\Controller\URLAlterTestController.
*/
namespace Drupal\url_alter_test\Controller;
use Symfony\Component\HttpFoundation\Response;
/**
* Controller routines for url_alter_test routes.
*/
class URLAlterTestController {
/**
* Prints Current and Request Path.
*
* @return \Symfony\Component\HttpFoundation\Response
* A response object.
*/
public function foo() {
return new Response('current_path=' . current_path() . ' request_path=' . request_path());
}
}
<?php
/**
* @file
* Module to help test altering the inbound and outbound path.
*/
/**
* Implements hook_menu().
*/
function url_alter_test_menu() {
$items['url-alter-test/foo'] = array(
'title' => 'Foo',
'page callback' => 'url_alter_test_foo',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
/**
* Menu callback.
*/
function url_alter_test_foo() {
print 'current_path=' . current_path() . ' request_path=' . request_path();
exit;
}
url_alter_test_foo:
pattern: 'url-alter-test/foo'
defaults:
_content: '\Drupal\url_alter_test\Controller\URLAlterTestController::foo'
requirements:
_permission: 'access content'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment