1
template.php에 HOOK_theme()을 선언 할 수 있습니다 (가능한 경우). 어떻게 선언 할 수 있습니까? 고마워요drupal --- template.php의 HOOK_theme()
template.php에 HOOK_theme()을 선언 할 수 있습니다 (가능한 경우). 어떻게 선언 할 수 있습니까? 고마워요drupal --- template.php의 HOOK_theme()
예, 테마의 template.php 파일에 hook_theme을 구현할 수 있습니다. 자세한 내용은 API documentation을 참조하십시오.
나는 그것을 읽었지만 그것을 사용하는 방법을 여전히 모른다. 그것을 설명 할 수있는 모범을 보여 주실 수 있습니까? 고맙습니다. – runeveryday
예를 들어, node_example 모듈이 hook_theme을 node_example_theme 함수 (http://api.drupal.org/api/examples/node_example--node_example.module/function/node_example_theme/6)로 구현하는 방법을 참조하십시오. 테마 훅과 받아 들일 수있는 인수를 정의합니다. 테마 후크가 정의되면'theme ('node_example_order_info', $ array)'를 호출 할 수 있습니다. 귀하의 모듈도 똑같이 할 수 있습니다. – marcvangend