드루팔 (Drupal 용 모듈 개발을 위해 노력하고 있습니다.포함 된 파일이 템플릿 외부에 표시됩니다.
다음 코드는 포함 된 파일을 제외하고는 잘 작동합니다. 포함 된 파일의 내용이 템플릿 외부에 표시되는 반면 나머지는 템플릿 내부에 올바르게 표시됩니다. 왜 이런 일이 일어나고 어떻게 해결할 수 있습니까?
drupal_add_css(drupal_get_path('module', 'helloworld') . '/helloworld.css', array('group' => CSS_DEFAULT, 'every_page' => TRUE));
function helloworld_menu(){
$items = array();
$items['helloworld'] = array(
'title' => t('Hello world'),
'page callback' => 'helloworld_output',
'access arguments' => array('access content'),
);
return $items;
}
function helloworld_display(){
include_once (dirname(__FILE__) . '/helloworld.display.php');
}
/*
* Display output
*/
function helloworld_output() {
header('Content-type: text/plain; charset=UTF-8');
header('Content-Disposition: inline');
$output = "<div id='hw_wrapper'>";
$output .= helloworld_display();
$output .= 'hej';
$output .= "</div>";
return $output;
}
helloworld.display.php 파일의 내용은 무엇입니까? – kiamlaluno
그냥 ph \t 에코 "Another hello world"; 그래서 이것은 내가 이것을 생각해서는 안됩니다. – mhmdrupal