inc文件是可以调用的php文件.
用来定义函数
inc文件的用法:
1、导入的方法module_load_include();
<?php
// Load node.admin.inc from the node module.
module_load_include('inc', 'node', 'node.admin');
// Load content_types.inc from the node module.
module_load_include('inc', 'node', 'content_types');
?>
2、菜单调用的方法
- 阅读更多 关于 inc文件的用法
- 登录或注册以发表评论
<?php
<?
function module_name_form() {
$form = array();
$form['city'] = array(
'#title' => t('City'),
'#type' => 'textfield',
'#autocomplete_path' => 'example/autocomplete',//--调用的路径
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Save',
);
return $form;
}
//--定义路径
function module_name_menu() {
$items['example/autocomplete'] = array(
'page callback' => '_module_name_autocomplete', //--调用数据
'access arguments' => array('access example autocomplete'),
'type' => MENU_CALLBACK
);
return $i
添加一个term reference的自动完成字段
<?php
// Clear the user access cache.
drupal_static_reset('user_access');
drupal_static_reset('user_role_permissions');
?>
主要用于角色编辑或者删除等操作完成以后更新权限。- 阅读更多 关于 清除用户权限缓存
- 登录或注册以发表评论
<?php
$items['contact'] = array(
'title' => 'Contact',
'page callback' => 'drupal_get_form',
'page arguments' => array('contact_site_form'),
'access arguments' => array('access site-wide contact form'),
'type' => MENU_SUGGESTED_ITEM, //--建议类型的菜单,可以开启
'file' => 'contact.pages.inc',
'file path'=>drupal_get_path('module','contact'),//--在其他模块里面调用的时候添加路径
);
?>
菜单定义函数hook_menu()
- 阅读更多 关于 drupal菜单定义
- 登录或注册以发表评论
- 阅读更多 关于 drupal模块开发分析
- 登录或注册以发表评论
比如说网站栏目有1,2,3,... 1下面有子栏目11,12,13 2下面有子栏目21,22,23...以此类推 现在我想做一个侧边栏,比如在首页点击1,进入栏目1中,左侧有侧边栏显示1的子栏目,请问高手如何做~?
标签
drupal 7 和 NodeReferrer 功能一样的模块有那个啊?
不知道为何,admin/modules页面打不开,update.php也打不开,其他页面都正常,求指导?