Skip to content

Commit

Permalink
Improve HTML Structure
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Jul 23, 2024
1 parent 39757b0 commit 2df408c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions framework/library/astroid/Element/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static function renderSublayout($source, $template = '', $type = 'layouts
'title'=> 'title'
]
];
$options['layout_type'] = 'sublayout';
$content = '';
foreach ($layout['sections'] as $section) {
$section = new Section($section, $devices, $options);
Expand Down
8 changes: 8 additions & 0 deletions framework/library/astroid/Element/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ class Section extends BaseElement
public $hasHeader = false;
public $hasFooter = false;

public function __construct($data, $devices, $options = array())
{
if (isset($options['layout_type']) && $options['layout_type'] == 'sublayout') {
$this->_tag = 'div';
}
parent::__construct($data, $devices, $options);
}

public function render()
{
$content = '';
Expand Down

0 comments on commit 2df408c

Please sign in to comment.