Skip to content

Instantly share code, notes, and snippets.

@xtfer
Last active July 20, 2016 02:46
Show Gist options
  • Save xtfer/789fd7c6f4ccc265e1eb to your computer and use it in GitHub Desktop.
Save xtfer/789fd7c6f4ccc265e1eb to your computer and use it in GitHub Desktop.
Ghost: Page Controller hook_menu example
<?php
/**
* @file
* Page Controller example for Ghost
*
* @license GPL v2 http://www.fsf.org/licensing/licenses/gpl.html
* @author Chris Skene chris at previousnext dot com dot au
* @copyright Copyright(c) 2014 Previous Next Pty Ltd
*/
/**
* Implements hook_menu().
*/
function ghost_examples_menu() {
$menu = array();
$menu['my/page/callback'] = array(
// Your page arguments should start with your Controller, and the method to call.
'page callback' => '\Drupal\\ghost\\Page\\PageController::createPage',
'page arguments' => array(
'\Drupal\\ghost_examples\\Page\\PageControllerExample',
'myPageControllerViewCallback',
),
);
return $menu;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment