开发者

link/include a .php file from drupal module

I'm using drupal 6, i'm a beginner at drupal module development. I try to implement the assignment algorithm, to assign a student to an internship. I have created a simple module, with a block, menu structure, and a table to show the students and internships (this part works). But, now I try to implement the algorithm (genetic algorithm) in PHP.

My question is can I refere from my menu to my genetic algorithm php file. I included my example so that you understand my question. This piece of code is a part of my menu, Now I just try to link my geneticAlgorithmClass.php class, Can I do that and can this work?

$items['admin/settings/planning/maak_planning'] = array(
        'title' => t('Maak planning'),
        'page callback' => 'planning_make_page',
        //'page arguments' => array('planning_settings'),
        'access arguments' =>开发者_开发知识库 array('access content'),
        'file' => 'geneticAlgorithmClass.php',
        'type' => MENU_LOCAL_TASK,
);


have you create this function"planning_make_page" in your file "geneticAlgorithmClass.php"

if yes then check is there any required parameters to this function. if yes then pass these paramerters like

$items['admin/settings/planning/maak_planning'] = array(
        'title' => t('Maak planning'),
        'page callback' => 'planning_make_page',
        'page arguments' => array('param1','param2',...),
        'access arguments' => array('access content'),
        'file' => 'geneticAlgorithmClass.php',
        'type' => MENU_LOCAL_TASK,
);

Then it should work

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜