10
나는 새로운 드루팔 7 테마를 생성하고이 같은 template.php에서 hook_theme을 구현하기 위해 노력 : drupal 7에서 hook_theme을 구현하는 방법은 무엇입니까?
function mytheme_theme($existing, $type, $theme, $path){
return array(
'mytheme_header'=>array(
'template'=>'header',
'path'=>$path.'/templates',
'type'=>'theme',
),
);
}
는 내가 템플릿 디렉토리에 header.tpl.php을 배치하고 모든 캐시를 삭제하고, 테마 함수를 호출
를
theme('mytheme_header', $vars);
및 header.tpl.php이 추천했습니다 :
<?php
fb('calling header template');//the function of FirePHP to output debug info
print '<div>Header</div>';
//...
내가 방화범 확인하고이 정보를 '헤더 템플릿 호출'을 얻을, 그것은 의미 그것은 header.tpl.php를 호출했지만 html 코드를 출력하지 않았습니다. 내 코드에 무슨 문제가 있습니까?
'arguments'은 이름이 바뀌 었습니다 드루팔 (Drupal 7의 변수들) – Clive
감사. 나는 그것을 고쳤다. :) –
변수의 문제가 아니 었습니다. 나는 FirePHP로 디버깅을했고, header.tpl.php를 발견했지만 html 코드를 출력하지 못했다. –