2013-02-21 4 views
0

Single элемент массива:Как отобразить этот вложенный массив с субблоками?

array(3) { 
    'name' => 
    string(19) "trigger_assignments" 
    'description' => 
    string(67) "Maps trigger to hook and operation assignments from trigger.module." 
    'fields' => 
    array(3) { 
    [0] => 
    array(3) { 
     'name' => 
     string(4) "hook" 
     'description' => 
     string(76) "Primary Key: The name of the internal Drupal hook; for example, node_insert." 
     'type' => 
     string(7) "varchar" 
    } 
    [1] => 
    array(3) { 
     'name' => 
     string(3) "aid" 
     'description' => 
     string(36) "Primary Key: Action's {actions}.aid." 
     'type' => 
     string(7) "varchar" 
    } 
    [2] => 
    array(3) { 
     'name' => 
     string(6) "weight" 
     'description' => 
     string(67) "The weight of the trigger assignment in relation to other triggers." 
     'type' => 
     string(3) "int" 
    } 
    } 
} 

Я не могу отобразить массив 'поля'. Оно должно быть отображение в таблице, мой код:

[c;block=begin; sub1=(fields)] 
Nazwa tabeli: [c.name;] 
[c.description;] 
Lista pól tabeli: 

Nazwa Typ Opis 
[c_sub1.name;block=tr] [c_sub1.type;] [c_sub1.description;] 

[c;block=end] 

Результат выборки:

Nazwa tabeli: aggregator_category 
Stores categories for aggregator feeds and feed items. 
Lista pól tabeli: 

Nazwa Typ Opis 
[c_sub1.name;block=tr] [c_sub1.type;] [c_sub1.description;] 

Так таблица с полями не отображается.

Может ли кто-нибудь дать мне какой-нибудь советник?

Код:

$TBS->MergeBlock('c', $table); 

$table имеет элементы, как выше внутри.

XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 wp14" xml:space="preserve"> 
<w:body> 
    <w:p w:rsidRDefault="00905443" w:rsidP="00273597"> 
    <w:r> 
    <w:t> 
    </w:t> 
    </w:r> 
    </w:p> 
    <w:p w:rsidRDefault="00595A19" w:rsidP="00273597"> 
    <w:r> 
    <w:t> 
    Nazwa tabeli: aggregator_category 
    </w:t> 
    </w:r> 
    </w:p> 
    <w:p w:rsidRDefault="008248E2" w:rsidP="00273597"> 
    <w:r> 
    <w:t> 
    Stores categories for aggregator feeds and feed items. 
    </w:t> 
    </w:r> 
    </w:p> 
    <w:p w:rsidRDefault="00462CAC" w:rsidP="00273597"> 
    <w:r> 
    <w:t> 
    Lista pól tabeli: 
    </w:t> 
    </w:r> 
    </w:p> 
    <w:p w:rsidRDefault="00F53554" w:rsidP="00F53554"> 
    <w:pPr> 
    <w:spacing w:after="0" w:line="240" w:lineRule="auto"/> 
    <w:rPr> 
    <w:rFonts w:ascii="Times New Roman" w:eastAsia="Times New Roman" w:hAnsi="Times New Roman"/> 
    <w:sz w:val="24"/> 
    <w:szCs w:val="24"/> 
    </w:rPr> 
    </w:pPr> 
    </w:p> 
    <w:tbl> 
    <w:tblPr> 
    <w:tblpPr w:leftFromText="141" w:rightFromText="141" w:vertAnchor="text" w:horzAnchor="margin" w:tblpXSpec="center" w:tblpY="425"/> 
    <w:tblW w:w="9606" w:type="dxa"/> 
    <w:tblBorders> 
    <w:top w:val="single" w:sz="4" w:space="0" w:color="auto"/> 
    <w:left w:val="single" w:sz="4" w:space="0" w:color="auto"/> 
    <w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/> 
    <w:right w:val="single" w:sz="4" w:space="0" w:color="auto"/> 
    <w:insideH w:val="single" w:sz="4" w:space="0" w:color="auto"/> 
    <w:insideV w:val="single" w:sz="4" w:space="0" w:color="auto"/> 
    </w:tblBorders> 
    <w:tblLook w:val="01E0" w:firstRow="1" w:lastRow="1" w:firstColumn="1" w:lastColumn="1" w:noHBand="0" w:noVBand="0"/> 
    </w:tblPr> 
    <w:tblGrid> 
    <w:gridCol w:w="2440"/> 
    <w:gridCol w:w="1567"/> 
    <w:gridCol w:w="5599"/> 
    </w:tblGrid> 
    <w:tr w:rsidTr="005C7EBF"> 
    <w:trPr> 
    <w:trHeight w:hRule="exact" w:val="340"/> 
    <w:tblHeader/> 
    </w:trPr> 
    <w:tc> 
    <w:tcPr> 
     <w:tcW w:w="2440" w:type="dxa"/> 
     <w:shd w:val="clear" w:color="auto" w:fill="C0C0C0"/> 
     <w:vAlign w:val="center"/> 
    </w:tcPr> 
    <w:p w:rsidRDefault="00CE4402" w:rsidP="005E0ABE"> 
     <w:pPr> 
     <w:spacing w:line="240" w:lineRule="auto"/> 
     <w:jc w:val="center"/> 
     <w:rPr> 
     <w:b/> 
     </w:rPr> 
     </w:pPr> 
     <w:r> 
     <w:rPr> 
     <w:b/> 
     </w:rPr> 
     <w:t> 
     Nazwa 
     </w:t> 
     </w:r> 
    </w:p> 
    </w:tc> 
    <w:tc> 
    <w:tcPr> 
     <w:tcW w:w="1567" w:type="dxa"/> 
     <w:shd w:val="clear" w:color="auto" w:fill="C0C0C0"/> 
    </w:tcPr> 
    <w:p w:rsidRDefault="00CE4402" w:rsidP="005E0ABE"> 
     <w:pPr> 
     <w:spacing w:line="240" w:lineRule="auto"/> 
     <w:jc w:val="center"/> 
     <w:rPr> 
     <w:b/> 
     </w:rPr> 
     </w:pPr> 
     <w:r> 
     <w:rPr> 
     <w:b/> 
     </w:rPr> 
     <w:t> 
     Typ 
     </w:t> 
     </w:r> 
    </w:p> 
    </w:tc> 
    <w:tc> 
    <w:tcPr> 
     <w:tcW w:w="5599" w:type="dxa"/> 
     <w:shd w:val="clear" w:color="auto" w:fill="C0C0C0"/> 
     <w:vAlign w:val="center"/> 
    </w:tcPr> 
    <w:p w:rsidRDefault="00CE4402" w:rsidP="005E0ABE"> 
     <w:pPr> 
     <w:spacing w:line="240" w:lineRule="auto"/> 
     <w:jc w:val="center"/> 
     <w:rPr> 
     <w:b/> 
     </w:rPr> 
     </w:pPr> 
     <w:r> 
     <w:rPr> 
     <w:b/> 
     </w:rPr> 
     <w:t> 
     Opis 
     </w:t> 
     </w:r> 
    </w:p> 
    </w:tc> 
    </w:tr> 
    <w:tr w:rsidTr="005C7EBF"> 
    <w:trPr> 
    <w:trHeight w:hRule="exact" w:val="521"/> 
    </w:trPr> 
    <w:tc> 
    <w:tcPr> 
     <w:tcW w:w="2440" w:type="dxa"/> 
    </w:tcPr> 
    <w:p w:rsidRDefault="005C7EBF" w:rsidP="005C7EBF"> 
     <w:pPr> 
     <w:spacing w:line="240" w:lineRule="auto"/> 
     </w:pPr> 
     <w:r> 
     <w:rPr> 
     <w:rFonts w:ascii="Verdana" w:eastAsia="Times New Roman" w:hAnsi="Verdana"/> 
     <w:color w:val="000000"/> 
     <w:sz w:val="18"/> 
     <w:szCs w:val="18"/> 
     </w:rPr> 
     <w:t> 
     [c_sub1.name;block=tr] 
     </w:t> 
     </w:r> 
    </w:p> 
    </w:tc> 
    <w:tc> 
    <w:tcPr> 
     <w:tcW w:w="1567" w:type="dxa"/> 
    </w:tcPr> 
    <w:p w:rsidRDefault="005C7EBF" w:rsidP="005C7EBF"> 
     <w:pPr> 
     <w:spacing w:after="0" w:line="240" w:lineRule="auto"/> 
     </w:pPr> 
     <w:r> 
     <w:rPr> 
     <w:rFonts w:ascii="Verdana" w:eastAsia="Times New Roman" w:hAnsi="Verdana"/> 
     <w:color w:val="000000"/> 
     <w:sz w:val="18"/> 
     <w:szCs w:val="18"/> 
     </w:rPr> 
     <w:t> 
     [c_sub1.type;] 
     </w:t> 
     </w:r> 
    </w:p> 
    </w:tc> 
    <w:tc> 
    <w:tcPr> 
     <w:tcW w:w="5599" w:type="dxa"/> 
    </w:tcPr> 
    <w:p w:rsidRDefault="005C7EBF" w:rsidP="005C7EBF"> 
     <w:pPr> 
     <w:spacing w:after="0" w:line="240" w:lineRule="auto"/> 
     </w:pPr> 
     <w:r> 
     <w:rPr> 
     <w:rFonts w:ascii="Verdana" w:eastAsia="Times New Roman" w:hAnsi="Verdana"/> 
     <w:color w:val="000000"/> 
     <w:sz w:val="18"/> 
     <w:szCs w:val="18"/> 
     </w:rPr> 
     <w:t> 
     [c_sub1.description;] 
     </w:t> 
     </w:r> 
    </w:p> 
    </w:tc> 
    </w:tr> 
    </w:tbl> 
    <w:p w:rsidRDefault="00A927EE" w:rsidP="00273597"> 
    <w:pPr> 
    <w:rPr> 
    <w:rStyle w:val="Strong"/> 
    <w:rFonts w:ascii="Verdana" w:hAnsi="Verdana"/> 
    <w:color w:val="006600"/> 
    <w:sz w:val="18"/> 
    <w:szCs w:val="18"/> 
    <w:shd w:val="clear" w:color="auto" w:fill="FFFFFF"/> 
    </w:rPr> 
    </w:pPr> 
    </w:p> 
    <w:p w:rsidRDefault="00905443" w:rsidP="00273597"> 
    <w:r> 
    <w:rPr> 
    <w:rFonts w:ascii="Verdana" w:hAnsi="Verdana"/> 
    <w:color w:val="000000"/> 
    <w:sz w:val="18"/> 
    <w:szCs w:val="18"/> 
    <w:shd w:val="clear" w:color="auto" w:fill="FFFFFF"/> 
    </w:rPr> 
    <w:t> 
    </w:t> 
    </w:r> 
    </w:p> 
    <w:sectPr> 
    <w:pgSz w:w="11906" w:h="16838"/> 
    <w:pgMar w:top="1417" w:right="1417" w:bottom="1417" w:left="1417" w:header="708" w:footer="708" w:gutter="0"/> 
    <w:cols w:space="708"/> 
    <w:docGrid w:linePitch="360"/> 
    </w:sectPr> 
</w:body> 
</w:document> 

ответ

0

Я не могу повторить свой результат с информацией, которую вы дали. С помощью этих двух тестовых файлов ваши данные, напечатанные таким образом:

<div> 
Name: trigger_assignments<Br> 
Maps trigger to hook and operation assignments from trigger.module. 
<Br >List: 
<table> 
    <tr> 
     <td>Nazwa</td> 
     <td>Typ</td> 
     <td>Opis</td> 
    </tr> 
    <tr> 
     <td>hook</td> 
     <td>varchar</td> 
     <td>Primary Key: The name of the internal Drupal hook; for example, node_insert.</td> 
    </tr><tr> 
     <td>aid</td> 
     <td>varchar</td> 
     <td>Primary Key: Action's {actions}.aid.</td> 
    </tr><tr> 
     <td>weight</td> 
     <td>int</td> 
     <td>The weight of the trigger assignment in relation to other triggers.</td> 
    </tr> 
</table> 
<br /><br /> 
</div> 

test.php:

$test = array(
    array ('name' => "trigger_assignments", 
     'description' => "Maps trigger to hook and operation assignments from trigger.module.", 
     'fields' => array(
      array('name' => "hook", 
       'description' => "Primary Key: The name of the internal Drupal hook; for example, node_insert.", 
       'type' => "varchar"), 
       array('name' => "aid", 
        'description' => "Primary Key: Action's {actions}.aid.", 
        'type' => "varchar"), 
       array('name' => "weight", 
        'description' => "The weight of the trigger assignment in relation to other triggers.", 
        'type' => "int") 
     ) 
    ) 
); 
include_once('includes/tbs_class.php'); 
$TBS = new clsTinyButStrong; 

$TBS->LoadTemplate('test.html'); 
$TBS->MergeBlock('test', $test); 

$TBS->Show(); 

И test.html:

<div> 
[test;block=begin; sub1=(fields)] 
Name: [test.name;]<Br> 
[test.description;] 
<Br >List: 
<table> 
    <tr> 
     <td>Nazwa</td> 
     <td>Typ</td> 
     <td>Opis</td> 
    </tr> 
    <tr> 
     <td>[test_sub1.name;block=tr]</td> 
     <td>[test_sub1.type;]</td> 
     <td>[test_sub1.description;]</td> 
    </tr> 
</table> 
<br /><br /> 
[test;block=end] 
</div> 

Не знаю, если это помогает. Может быть, вы могли бы дать немного больше информации о вашей переменной «c» и вашей команде $ TBS-> mergeBlock()?

+0

Я забыл, что это формат docx – drupality

+0

Можете ли вы изменить свой $ TBS-> Показать() на $ TBS-> Show (OPENTBS_DEBUG_XML); и посмотрите, будут ли ваши теги [c_sub1] выглядеть нормально в выводимом XML? –

+0

вопрос отредактирован – drupality

Смежные вопросы