0
votes

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,
);
1
Hmm... What does not work? Does the function planning_make_page exist on geneticAlgorithmClass.php or at the file you are setting your menu? If yes, I don't see why it shouldn't work. - acm
The problem is, in planning_make_page a load all data from my content types (student and internship), I need these data in my genetic algorithm. - user001

1 Answers

2
votes

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