Ich bin neu bei Drupal, ich habe ein benutzerdefiniertes Modul mit PHP, die Liste der Schüler mit Informationen zeigt, und klicken Sie auf den Menüpunkt Untermenü, benannt, Student Info. Bitte führen Sie Schritt für Schritt durch.So rufen Sie Custom Module in Drupal
-2
A
Antwort
1
Der Ausgangspunkt für die Generierung eines "Seitenrückrufs" (im Wesentlichen eine URL in Drupal aktiv) wäre hook_menu. Wie vorgeschlagen, werfen Sie einen Blick auf die Dokumentation, aber ein Ausgangspunkt, um Ihre Callback-Arbeit wirklich in einer my_module.module-Datei zu machen wäre:
/**
* Implements hook_menu().
*/
function my_module__menu() {
$items = array();
$items['student-info'] = array(
'title' => 'Student Info', // This becomes the page title
'description' => 'Information about students.', // this is the link description
'page callback' => 'function_name_that_outputs_content', // this is the page callback function that will fire
'type' => MENU_CALLBACK, // this is the type of menu callback, there are several that you can use depending on what your needs are.
);
return $items; // make sure you actually return the items.
}
/**
* Output the page contents when someone visits http://example.com/student-info.
*/
function function_name_that_outputs_content() {
$output = 'My page content'
return $output;
}
Verwandte Themen
- 1. So rufen Sie Module in lib Ordner
- 2. So rufen Sie Ajax in Prestashop Frontend Custom Modul
- 3. Drupal Custom Node Formular
- 4. Drupal Custom Modul HTML
- 5. Drupal: Rufen Sie drupal_get_form von AJAX
- 6. Glassfish Custom Authentication Module?
- 7. Set Drupal Module Gewicht
- 8. Drupal Update-Module und Kernstrategie
- 9. So rufen Sie in C#
- 10. So rufen Sie ein Befehlszeilenprogramm in WiX
- 11. So rufen Sie Destructor
- 12. So rufen Sie eine Richtlinie in angularjs
- 13. Custom Module mit Bonfire CI auf Cpanel
- 14. So erstellen Sie einfache Akkordeons in Drupal
- 15. So rufen Sie eine RESTful-API nach drupal-Knoten in erstellt, aktualisiert oder gelöscht
- 16. So rufen Sie Funktionsparameter ab
- 17. Android - So rufen Sie Wechselkurse
- 18. So rufen Sie ICorDebug auf
- 19. So rufen Sie MainActivity-Methode
- 20. So verwenden Sie installierte Module in Aurelia
- 21. So rufen Sie die Funktion
- 22. So rufen Sie Monitor.TryEnter auf
- 23. So rufen Sie onSaveInstanceState() manuell
- 24. So rufen Sie unique() auf dask DataFrame
- 25. wie veraltete drupal-Module zu kennen?
- 26. So rufen Sie EJB in PhaseListener
- 27. So rufen Sie Coroutine in LateUpdate
- 28. So rufen Sie JavaScript in XML auf?
- 29. So rufen Sie Skalarfunktion in QueryOver-Anweisung
- 30. So rufen Sie UDF in DataStage auf?
Willkommen bei Stack, Neetu! Bitte geben Sie uns einen Code und Beispiele, damit wir Ihnen bei Ihrer Frage helfen können. –
Bitte lesen Sie die Dokumentation, bevor Sie auf stackoverflow https://www.drupal.org/docs//creating-custom-modules nachfragen – Fky