diff --git a/src/PHPDraft/Model/Elements/DataStructureElement.php b/src/PHPDraft/Model/Elements/DataStructureElement.php index 0ab175b7..090b25ee 100644 --- a/src/PHPDraft/Model/Elements/DataStructureElement.php +++ b/src/PHPDraft/Model/Elements/DataStructureElement.php @@ -158,6 +158,7 @@ function __toString() if (is_string($object) || get_class($object) === self::class || get_class($object) === ArrayStructureElement::class + || get_class($object) === RequestBodyElement::class || get_class($object) === EnumStructureElement::class ) { @@ -171,7 +172,7 @@ function __toString() } $type = (!in_array($this->type, self::DEFAULTS)) ? - '' . $this->type . '' : '' . $this->type . ''; + '' . $this->type . '' : '' . $this->type . ''; if (is_null($this->value)) { @@ -179,7 +180,7 @@ function __toString() } else { - if (is_object($this->value) && self::class === get_class($this->value)) + if (is_object($this->value) && (self::class === get_class($this->value) || RequestBodyElement::class === get_class($this->value))) { $value = '
' . $this->value . '
'; } diff --git a/src/PHPDraft/Model/HTTPRequest.php b/src/PHPDraft/Model/HTTPRequest.php index a9197051..801d3075 100644 --- a/src/PHPDraft/Model/HTTPRequest.php +++ b/src/PHPDraft/Model/HTTPRequest.php @@ -71,6 +71,9 @@ public function parse($object) if ($value->element === 'dataStructure') { $this->parse_structure($value->content); + echo '
';
+                    var_dump($this->struct);
+                    echo '
'; continue; } elseif ($value->element === 'asset') @@ -117,6 +120,7 @@ private function parse_structure($objects) $this->struct[] = $struct; } + } /** diff --git a/src/PHPDraft/Model/HierarchyElement.php b/src/PHPDraft/Model/HierarchyElement.php index db9f07a4..79e5dbff 100644 --- a/src/PHPDraft/Model/HierarchyElement.php +++ b/src/PHPDraft/Model/HierarchyElement.php @@ -84,6 +84,6 @@ public function get_href() $seperator = '-'; $prep = ($this->parent !== NULL) ? $this->parent->get_href() . $seperator : ''; - return $prep . str_replace(' ', $seperator, strtolower($this->title)); + return $prep . str_replace(' ', '__', strtolower($this->title)); } } \ No newline at end of file diff --git a/src/PHPDraft/Out/HTML/default.php b/src/PHPDraft/Out/HTML/default.php index dd61b831..bcb29031 100644 --- a/src/PHPDraft/Out/HTML/default.php +++ b/src/PHPDraft/Out/HTML/default.php @@ -90,7 +90,7 @@ class="pull-right get_method_icon($transition->get_method()); ?>"> base_structures as $key => $structure): ?>
  • - +
  • @@ -180,9 +180,11 @@ class="value"> request->struct)): ?>
    Structure
    - request->struct as $value): ?> - - +
    + request->struct as $value): ?> + + +
    @@ -250,7 +252,8 @@ class="value"> - + @@ -262,23 +265,23 @@ class="value"> - base_structures) > 0):?> -

    Data structures

    - base_structures as $key => $structure): ?> -
    -
    -

    - -

    -
    -
    -
    - + base_structures) > 0): ?> +

    Data structures

    + base_structures as $key => $structure): ?> + -
    - - + +
    @@ -288,6 +291,6 @@ class="value"> - + \ No newline at end of file diff --git a/src/PHPDraft/Out/TemplateGenerator.php b/src/PHPDraft/Out/TemplateGenerator.php index 0c2909c2..dd38af6e 100644 --- a/src/PHPDraft/Out/TemplateGenerator.php +++ b/src/PHPDraft/Out/TemplateGenerator.php @@ -170,4 +170,9 @@ function get_response_status($response) } } + function strip_link_spaces($key) + { + return str_replace(' ', '__', strtolower($key)); + } + } \ No newline at end of file