'Services', 'description' => 'Manage services endpoints.', 'route_name' => 'services.list', ); $items['admin/structure/services/list'] = array( 'title' => 'List', 'type' => MENU_DEFAULT_LOCAL_TASK, ); $items['admin/structure/services/add'] = array( 'title' => 'Add new endpoint', 'route_name' => 'services.add', 'type' => MENU_LOCAL_ACTION, ); return $items; } /** * Implements hook_permission(). */ function services_permission() { return array( 'administer services' => array( 'title' => t('Administer services'), 'description' => t('Access the services administration pages.'), 'restrict access' => TRUE, ), ); } /** * Loads endpoint from configuration. * * @param string $name * The name of the endpoint * * @return \Drupal\Core\TypedData\TypedDataInterface */ function services_get_endpoint($name) { $view = entity_load('endpoint', $name); return $view; }