0
양식이있는 Drupal 페이지를 만들고 싶습니다.Drupal 6 페이지 및 양식 맞춤 모듈
function score_table_menu() {
$items['table'] = array(
'title' => t('name'),
'page arguments' => array('table_page'),
'page arguments' => array('table_form'),
'description' => t('score table'),
'type' => MENU_CALLBACK,
);
return $items;
}
function table_page(){
$output .= t('Complicated Hello');
$header = stuff;
$rows = stuff;
$output .= theme_table($header, $rows);
return $output;
}
function table_form(){
$stuff_array = array (values);
$form['choice']= array(
'#type' => 'select',
'#title' => t('Select Stuff'),
'#options' => $stuff_array,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Submit',
);
return $form;
}
function table_form_validate(){}
function table_form_submit(){
drupal_set_message(t('Submitted'));
}
이 절반 모듈은 페이지와 다른 반 양식을 렌더링 가질 수 있습니다 : 렌더링하지 않습니다 다음과 같은 뭔가? 나는 두 페이지의 주장을 썼다. 페이지 인수와 콜백간에 차이점은 없습니다. 또한 페이지에서 양식을 렌더링하려면 drupal_get_form()을 사용해야 할 수도 있습니다.
'#type'=> '마크 업', '#markup'=> theme_table ($ header, $ rows)이 drupal 6에서 작동합니까? 귀하의 대답은 페이지 절반과 양식 절반을 갖는 방법을 다루고 있습니까? – ingrid
예, #markup => 존재하지 않습니다 ... – ingrid
ok 간단하게 편집하십시오. #markup은 실제로 drupal에서 #value 여야합니다. 6 – ingrid