By bilvanisli on
function maliyet_poz_menu(){
$items = array();
$items['maliyet/pozara'] = array(
'page callback' => 'maliyet_poz_ara',
'page arguments' =>array(),
'access arguments' =>array('search poz'),
'type' => MENU_CALLBACK,
);
function maliyet_poz_ara($op='search',$result=array())
{
if($op=='search')
return drupal_get_form('maliyet_poz_ara_form');
else
return '<p>Hi...</p>';
}
How can I call "maliyet/pozara" item with "$op" and "$result" arguments. I can't use if statement in "maliyet_poz_ara()"
I've tried
.
.
.
$result=....;
drupal_goto(url('maliyet/pozara','other',$result, TRUE))but I couldn't success.
Comments
I see you have implemented
I see you have implemented the hook_menu. I don't understand what you're trying to achieve, but the menu hook isn't implemented correctly. You just have to specify the menu items, no callback methods.
If you want to pass an argument you must also specify this in the menu-item, there are different methods to do this, check the api for this. http://api.drupal.org/api/function/hook_menu/6
argument
after form submit, i want to show results array of form named 'maliyet_poz_ara'. I know its interesting :) But i don't know how can I do this. can i show the results in the same page or i have to add new menu item register?
in the search module, results page called with keys. May be i can do this. Thanks anyway.
$result is an array
As i see from your code, you are also trying to pass $result as an argument which is an array. you may only pass simple types as menu arguments.
You should check your logic to avoid passing an array as argument.
Showing the results on the same page is pretty easy , you can try that.
Sudhir