我是新來的主持,我只是繼承了這段代碼。我需要控制在何處以及如何打印#output,但它始終顯示在頁面頂部,位於HTML標記上方。我查看了可渲染的數組API,但找不到特定於我的問題的任何內容。如何從內容數組屬性中輸出html?
在mytheme.module:
function mytheme_output_block() {
$content = array(
'#theme' => 'my_theme',
'#output' => function_that_returns_JSON();
...
function mytheme_hook_theme() {
return array(
'my_theme' => array(
'vars' => array(
'output' => '',
...
而在my_theme.tpl.php我想:
<?php print $output; ?>
但它被忽略。如何控制#輸出,以便我可以設計它?
你能發佈更完整的代碼集,特別是my_theme.tpl.php嗎? – Matz
不是真的:(但其他應該沒關係,因爲我只關心打印$輸出。 – user3052659