[D7] Ghi chú cho đẩy link item module vào menu trong Admin Durpal

Post Reply
tthlan
Quản trị viên
Posts: 75
Joined: Tue Aug 23, 2016 8:13 am

[D7] Ghi chú cho đẩy link item module vào menu trong Admin Durpal

Post by tthlan »

trong file test_form.module, cài đặt hook_menu và các function khác cho module test như sau

Code: Select all

function test_form_menu() {
	$items = array();

	$items['admin/test_form'] = array(
 	'title' => 'Test Module',
	'access arguments' => array('administer'), // Noted this
	'page callback' => 'test_one',
 	'expanded' => TRUE,
    );

    return $item;
}

Code: Select all

function test_one() {
    return theme('theme_test');
}

Code: Select all

function test_form_theme() {
   return array(
	'test_form' => array(
	'template' => 'theme_test', //theme_test.tpl.php
   	'variables' => array('par' => NULL),
   	),
   );
}

Clear Cache System

Image


Và kết quả như bên dưới

Image
Post Reply